chiark / gitweb /
test suite: gitattributes: check that dotfiles work properly too
[dgit.git] / tests / tests / gitattributes
index 0b361ada3d99310fec167eaef90c2531d85758cb..bdc61f8afd980b80d6d35309b08623ba025a456b 100755 (executable)
@@ -48,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
@@ -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