From a2b565b98cf2235619ec555c067d8828197c5986 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 17 Jan 2017 12:25:53 +0000 Subject: test suite: gitattributes: Break out sums_check No functional change. Signed-off-by: Ian Jackson --- tests/tests/gitattributes | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes index fd3faa3..a00c1d3 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 ----- -- cgit v1.2.3