aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-26 00:27:33 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-26 00:27:33 -0700
commit6ba8b079cbe49e2e49bc26a0ca2e47185337142c (patch)
treeaad000ecd7316a43ee2e6e8ffb31e9955e9609e9 /t
parentb71fdc590d660f81e8e2ebfdab989feb60e86dde (diff)
parentb997045e01c2f12ac7dc44c487915f8e50da4d4d (diff)
downloadgit-6ba8b079cbe49e2e49bc26a0ca2e47185337142c.tar.gz
git-6ba8b079cbe49e2e49bc26a0ca2e47185337142c.tar.xz
Merge branch 'jc/attributes-checkout'
* jc/attributes-checkout: Add a test for checking whether gitattributes is honored by checkout. Read attributes from the index that is being checked out
Diffstat (limited to 't')
-rwxr-xr-xt/t0020-crlf.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 1be7446d8..4e72b5314 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -429,6 +429,37 @@ test_expect_success 'in-tree .gitattributes (4)' '
}
'
+test_expect_success 'checkout with existing .gitattributes' '
+
+ git config core.autocrlf true &&
+ git config --unset core.safecrlf &&
+ echo ".file2 -crlfQ" | q_to_cr >> .gitattributes &&
+ git add .gitattributes &&
+ git commit -m initial &&
+ echo ".file -crlfQ" | q_to_cr >> .gitattributes &&
+ echo "contents" > .file &&
+ git add .gitattributes .file &&
+ git commit -m second &&
+
+ git checkout master~1 &&
+ git checkout master &&
+ test "$(git diff-files --raw)" = ""
+
+'
+
+test_expect_success 'checkout when deleting .gitattributes' '
+
+ git rm .gitattributes &&
+ echo "contentsQ" | q_to_cr > .file2 &&
+ git add .file2 &&
+ git commit -m third
+
+ git checkout master~1 &&
+ git checkout master &&
+ remove_cr .file2 >/dev/null
+
+'
+
test_expect_success 'invalid .gitattributes (must not crash)' '
echo "three +crlf" >>.gitattributes &&