Subject: [PATCH 3/8] archive: add a failure test wrt .gitattributes misreading

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Wed, 8 Apr 2009 20:05:28 +1000

"git archive" is used to create archives from a tree (or commit), so
it should not consult any .gitattributes files on working directory.

It currently does, so this patch records the failure.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 t/t0024-crlf-archive.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh
index c7d0324..9c56e0e 100755
--- a/t/t0024-crlf-archive.sh
+++ b/t/t0024-crlf-archive.sh
@@ -43,4 +43,11 @@ test_expect_success UNZIP 'zip archive' '
 
 '
 
+test_expect_failure '.gitattributes in workdir should not be consulted' '
+	echo "sample -crlf" > .gitattributes &&
+	git archive --format=tar HEAD |
+	( mkdir untarred2 && cd untarred2 && "$TAR" -xf - )
+	test_cmp sample untarred2/sample
+'
+
 test_done
-- 
1.6.2.2.602.g83ee9f