chiark / gitweb /
test suite: gitattributes: Remove .git from orig
[dgit.git] / tests / tests / gitattributes
index c8d1b0ae64fa353f46c9388527c6b51b456ccef5..7b0818a0cf9177d5cc6f9fbe063b2372d272d102 100755 (executable)
@@ -100,6 +100,21 @@ sfmt_import () {
        mkdir $pdb-import-$inst
        cd $pdb-import-$inst
        git init
+
+       t-dgit $dgitargs import-dsc ../${p}_${v}.dsc +$refname.broken
+       git checkout $refname.broken
+       sha256sum af/* >../$sums.broken
+
+       for s in ../sums ../$sums.broken; do
+               sed 's/[0-9a-f]* //' $s >$s.nosums
+       done
+       diff -U0 ../sums.nosums ../$sums.broken.nosums
+       set +e
+       diff -U0 ../sums ../$sums.broken
+       rc=$?
+       set -e
+       test $rc = 1
+
        t-dgit setup-new-tree
 
        t-dgit $dgitargs import-dsc ../${p}_${v}.dsc +$refname
@@ -108,9 +123,10 @@ sfmt_import () {
        sums=sums.$sfmt-$inst
 
        for f in af/*; do
-               git cat-file blob "refs/heads/$refname:$f" | sha256sum | \
-                       sed -e 's#-$#'$f'#' \
-                       >>../$sums
+               git cat-file blob "refs/heads/$refname:$f" \
+                       | sha256sum \
+                       | sed -e 's#-$#'$f'#' \
+               >>../$sums
        done
 
        cd ..
@@ -119,7 +135,7 @@ sfmt_import () {
 
 : ----- generate the orig -----
 
-tar --exclude=debian -zcf ${p}_${bv}.orig.tar.gz $p
+tar --exclude=debian --exclude=.git -zcf ${p}_${bv}.orig.tar.gz $p
 
 : ----- test 1.0 native -----