summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06f33c1)
raw | patch | inline | side by side (parent: 06f33c1)
author | Kristian Amlie <kristian.amlie@nokia.com> | |
Fri, 20 Mar 2009 09:32:09 +0000 (10:32 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 20 Mar 2009 16:36:16 +0000 (09:36 -0700) |
The original bug will not honor new entries in gitattributes if they
are changed in the same checkout as the files they affect.
It will also keep using .gitattributes, even if it is deleted in the
same commit as the files it affects.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
are changed in the same checkout as the files they affect.
It will also keep using .gitattributes, even if it is deleted in the
same commit as the files it affects.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0020-crlf.sh | patch | blob | history |
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 1be7446d8d9f8a46b463f2474a8c25bdd33044d2..4e72b53140bd35db87a6c873eda9e75e896e1cdd 100755 (executable)
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
}
'
+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 &&