From: Ian Jackson Date: Tue, 17 Jan 2017 12:25:53 +0000 (+0000) Subject: test suite: gitattributes: Break out sums_check X-Git-Tag: archive/debian/3.5~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=a2b565b98cf2235619ec555c067d8828197c5986 test suite: gitattributes: Break out sums_check No functional change. Signed-off-by: Ian Jackson --- diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes index fd3faa35..a00c1d36 100755 --- a/tests/tests/gitattributes +++ b/tests/tests/gitattributes @@ -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 -----