chiark / gitweb /
test suite: gitattributes: Break out sums_check
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Jan 2017 12:25:53 +0000 (12:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Jan 2017 12:30:13 +0000 (12:30 +0000)
No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/gitattributes

index fd3faa3..a00c1d3 100755 (executable)
@@ -103,6 +103,20 @@ sfmt_setup () {
        cd ..
 }
 
+sums_check () {
+       # caller should cd into working directory and set
+       #   $sums  $branch
+
+       for f in af/*; do
+               git cat-file blob "refs/heads/$branch:$f" \
+                       | sha256sum \
+                       | sed -e 's#-$#'$f'#' \
+               >>../$sums
+       done
+
+       diff -U0 ../sums ../$sums
+}
+
 sfmt_import () {
        inst=$1
        dgitargs=$2
@@ -137,15 +151,9 @@ sfmt_import () {
        t-dgit $dgitargs import-dsc ../$dscf +$branch
        git checkout $branch
 
-       for f in af/*; do
-               git cat-file blob "refs/heads/$branch:$f" \
-                       | sha256sum \
-                       | sed -e 's#-$#'$f'#' \
-               >>../$sums
-       done
+       sums_check
 
        cd ..
-       diff -U0 sums $sums
 }
 
 : ----- generate the orig -----