diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2018-06-28 11:52:54 +0100 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2018-06-28 11:52:54 +0100 |
commit | 4613f20fafd20f738291b355aced2bb4798ca2b1 (patch) | |
tree | e7d9bf11336468eda8076d71240368608cffea0e /tests/tests/gitattributes | |
parent | 36454d4896b806632a7b8b8f08e1b5ec16a1cc4e (diff) | |
parent | 152ccd540c3f7809d8235d0907eb0142aed792f4 (diff) |
Merge tag 'debian/5.2' into wip/stretch-bpo
dgit release 5.2 for unstable (sid) [dgit]
[dgit distro=debian]
# gpg: Signature made Sun 24 Jun 2018 23:36:20 BST
# gpg: using RSA key 559AE46C2D6B6D3265E7CBA1E3E3392348B50D39
# gpg: Can't check signature: No public key
Diffstat (limited to 'tests/tests/gitattributes')
-rwxr-xr-x | tests/tests/gitattributes | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes index 9e1c246..bdc61f8 100755 --- a/tests/tests/gitattributes +++ b/tests/tests/gitattributes @@ -22,12 +22,20 @@ badattr1 () { printf >>af/$filename 'crlf: \r\n' echo >>af/$filename 'id $Id: $' echo >>af/$filename 'id $Id: SPLARK $' + printf >>af/$filename '\xEF\xBB\xBF <- UTF-8 BOM\n' echo >>gitattrs "af/$filename" "$attrspec" } badattr () { attrname=$1; shift - badattr1 $attrname-set $attrname + + case "$attrname" in + working-tree-encoding) ;; + *) + badattr1 $attrname-set $attrname + ;; + esac + badattr1 $attrname-unset -$attrname badattr1 $attrname-unspec \!$attrname local val @@ -40,6 +48,9 @@ badattr () { 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 @@ -57,6 +68,7 @@ badattr export-ignore badattr export-subst badattr delta badattr encoding no-such-encoding +badattr working-tree-encoding ISO-8859-1 UTF-16 man gitattributes \ | perl -ne 'print $1,"\n" if m/^ *(\w[-a-z]*)$/' \ @@ -67,7 +79,7 @@ while read attr; do badattr $attr done -sha256sum af/* >sums +sha256sum .dotfile-attr af/* >sums # ----- common to source formats ----- @@ -92,7 +104,7 @@ sfmt_setup () { cp ../gitattrs .gitattributes $addpatch gitattrs - cp -a ../af . + cp -a ../af ../.dotfile-attr . $addpatch files cp ../sums . @@ -108,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'#' \ @@ -126,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 @@ -178,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 @@ -239,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 .. @@ -253,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 |