chiark / gitweb /
test suite: gitattributes: test unsetup tree, too
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 Jan 2017 22:19:55 +0000 (22:19 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 16 Jan 2017 01:25:02 +0000 (01:25 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/gitattributes

index c8d1b0a..74dbdde 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 ..