From: Kristian Amlie Date: Thu, 12 Mar 2009 09:36:14 GMT Subject: [PATCH 1/2] Add a test for checking whether gitattributes is honored by checkout. Message-ID: <1236850575-27973-2-git-send-email-kristian.amlie@nokia.com> In-Reply-To: <1236850575-27973-1-git-send-email-kristian.amlie@nokia.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/t2013-checkout-crlf.sh | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) create mode 100755 t/t2013-checkout-crlf.sh diff --git a/t/t2013-checkout-crlf.sh b/t/t2013-checkout-crlf.sh new file mode 100755 index 0000000..cb997a8 --- /dev/null +++ b/t/t2013-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.2.105.g16bc7.dirty