X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Fgitattributes;h=e6089bd9cdda9007c597a7e2c9728cf9a3e90d48;hb=7a88b9a4054ffa6e79f3b1f7f608de08793e22d2;hp=286395d6b5e7fd968b334a556580d8300c1abe84;hpb=e48845631c7506536bd1ff9c343b49c7cd670e5a;p=dgit.git diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes index 286395d6..e6089bd9 100755 --- a/tests/tests/gitattributes +++ b/tests/tests/gitattributes @@ -103,22 +103,41 @@ sfmt_setup () { cd .. } +sums_check () { + # caller should cd into working directory, set + # $sums $branch + # and check out $branch + + sha256sum af/* >../$sums.checkout + diff -U0 ../sums ../$sums.checkout + + 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 - refname="import.$sfmt-$inst" + branch="import.$sfmt-$inst" brkerr=stderr.$sfmt-$inst.broken dscf=${p}_${v}.dsc + sums=sums.$sfmt-$inst mkdir $pdb-import-$inst cd $pdb-import-$inst git init LC_MESSAGES=C \ - t-dgit $dgitargs import-dsc ../$dscf +$refname.broken \ + t-dgit $dgitargs import-dsc ../$dscf +$branch.broken \ 2>&1 |tee ../$brkerr fgrep 'warning: source tree contains .gitattributes' ../$brkerr - git checkout $refname.broken + git checkout $branch.broken sha256sum af/* >../$sums.broken for s in ../sums ../$sums.broken; do @@ -133,20 +152,13 @@ sfmt_import () { t-dgit setup-new-tree - t-dgit $dgitargs import-dsc ../$dscf +$refname - git checkout $refname + t-dgit $dgitargs import-dsc ../$dscf +$branch + git checkout $branch + git reset --hard - sums=sums.$sfmt-$inst - - for f in af/*; do - git cat-file blob "refs/heads/$refname:$f" \ - | sha256sum \ - | sed -e 's#-$#'$f'#' \ - >>../$sums - done + sums_check cd .. - diff -U0 sums $sums } : ----- generate the orig -----