X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Fgitattributes;h=9ebc2161c83bb600f4eaf2a5156d4a4a159469b6;hb=cc245dcf0eda3ff55a3b1f2cabffd06d2c503eea;hp=04c6b870c29efe1220f12d8ceb670ba7fb89479f;hpb=61016923b2a47b0550e36ed5f5a929d401811b42;p=dgit.git diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes index 04c6b870..9ebc2161 100755 --- a/tests/tests/gitattributes +++ b/tests/tests/gitattributes @@ -44,10 +44,13 @@ badattr () { done } -# xxx want to make each of these files into a quilt patch +# todo: want to make each of these files into a quilt patch t-git-config core.eol crlf +printf >>.dotfile-attr 'dotfiles too?\n' +echo >>gitattrs '.dotfile-attr filter=dgit-test-crazy-f' + badattr text auto badattr eol lf crlf badattr ident @@ -76,7 +79,7 @@ while read attr; do badattr $attr done -sha256sum af/* >sums +sha256sum .dotfile-attr af/* >sums # ----- common to source formats ----- @@ -101,7 +104,7 @@ sfmt_setup () { cp ../gitattrs .gitattributes $addpatch gitattrs - cp -a ../af . + cp -a ../af ../.dotfile-attr . $addpatch files cp ../sums . @@ -117,10 +120,10 @@ sums_check () { # $sums $branch # and check out $branch - sha256sum af/* >../$sums.checkout + sha256sum .dotfile-attr af/* >../$sums.checkout diff -U0 ../sums ../$sums.checkout - for f in af/*; do + for f in .dotfile-attr af/*; do git cat-file blob "refs/heads/$branch:$f" \ | sha256sum \ | sed -e 's#-$#'$f'#' \ @@ -135,7 +138,7 @@ sums_check_broken () { # $sums # and check out the broken branch - sha256sum af/* >../$sums.broken + sha256sum .dotfile-attr af/* >../$sums.broken for s in ../sums ../$sums.broken; do sed 's/[0-9a-f]* //' $s >$s.nosums @@ -187,7 +190,7 @@ sfmt_import () { t-dgit-warn-check 1 $dgitargs import-dsc ../$dscf +$branch git checkout $branch - touch af/* + touch .dotfile-attr af/* git reset --hard sums_check @@ -248,7 +251,7 @@ t-dgit-warn-check 0 -cdgit.default.setup-gitattributes=false \ clone $p sid $p.clone.broken cd $p.clone.broken -sums=$p.clone.broken +sums=sums.broken sums_check_broken cd .. @@ -262,4 +265,24 @@ sums_check cd .. +t-dgit-warn-check 0 -cdgit.default.setup-gitattributes=false \ + clone $p sid $p.clone.old + +cd $p.clone.old + +mkdir -p .git/info +cat >.git/info/attributes <<'END' +* dgit-defuse-attrs +[attr]dgit-defuse-attrs -text -eol -crlf -ident -filter +# ^ see GITATTRIBUTES in dgit(7) and dgit setup-new-tree in dgit(1) +END + +t-dgit setup-gitattributes +git reset --hard + +sums=sums.old +sums_check + +cd .. + t-ok