From: Kristian Amlie Date: Fri, 30 Jan 2009 13:00:13 GMT Subject: [PATCH] Add a test for checking whether gitattributes is honored by checkout. Message-ID: <1233320413-28069-2-git-send-email-kristian.amlie@trolltech.com> In-Reply-To: <1233320413-28069-1-git-send-email-kristian.amlie@trolltech.com> The original bug will not honor new entries in gitattributes if they are changed in the same checkout as the files they affect. --- t/t2012-checkout-crlf.sh | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) create mode 100755 t/t2012-checkout-crlf.sh diff --git a/t/t2012-checkout-crlf.sh b/t/t2012-checkout-crlf.sh new file mode 100755 index 0000000..cb997a8 --- /dev/null +++ b/t/t2012-checkout-crlf.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +test_description='checkout should honor .gitattributes' + +. ./test-lib.sh + +test_expect_success 'setup' ' + + git config core.autocrlf true && + printf "dummy dummy=true\r\n" > .gitattributes && + git add .gitattributes && + git commit -m initial && + printf "file -crlf\n" >> .gitattributes && + printf "contents\n" > file && + git add .gitattributes file && + git commit -m second + +' + +test_expect_success 'checkout with existing .gitattributes' ' + + git checkout master~1 && + git checkout master && + test "$(git diff-files --raw)" = "" + +' + +test_done + -- 1.6.0.3