git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 5/5] archive test: test new --fix-attributes feature

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 17, 2009, 19:53 UTC
Message-ID
<49E8DE50.5000908@lsrfire.ath.cx>
In-Reply-To
<1239848917-14399-6-git-send-email-gitster@pobox.com>

Could you please squash in the following, which adds test cases for bare repos and gives every export-ignore file existence test its own test case? And also

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
?
 t/t5001-archive-attr.sh |   46 ++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh
index b754f21..dd93c3f 100755
--- a/t/t5001-archive-attr.sh
+++ b/t/t5001-archive-attr.sh
@@ -6,6 +6,14 @@ test_description='git archive attribute tests'
 
 SUBSTFORMAT=%H%n
 
+test_expect_exists() {
+	test_expect_success " $1 exists" "test -e $1"
+}
+
+test_expect_missing() {
+	test_expect_success " $1 does not exist" "test ! -e $1"
+}
+
 test_expect_success 'setup' '
 	echo ignored >ignored &&
 	echo ignored export-ignore >>.git/info/attributes &&
@@ -25,7 +33,10 @@ test_expect_success 'setup' '
 	echo "substfile?" export-subst >>.git/info/attributes &&
 	git add nosubstfile substfile1 substfile2 &&
 
-	git commit -m.
+	git commit -m. &&
+
+	git clone --bare . bare &&
+	cp .git/info/attributes bare/info/attributes
 '
 
 test_expect_success 'git archive' '
@@ -33,20 +44,34 @@ test_expect_success 'git archive' '
 	(mkdir archive && cd archive && "$TAR" xf -) <archive.tar
 '
 
+test_expect_missing	archive/ignored
+test_expect_missing	archive/ignored-by-tree
+test_expect_exists	archive/ignored-by-worktree
+
 test_expect_success 'git archive with worktree attributes' '
 	git archive --fix-attributes HEAD >worktree.tar &&
 	(mkdir worktree && cd worktree && "$TAR" xf -) <worktree.tar
 '
 
-test_expect_success 'export-ignore' '
-	test ! -e archive/ignored &&
-	test ! -e archive/ignored-by-tree &&
-	test   -e archive/ignored-by-worktree &&
-	test ! -e worktree/ignored &&
-	test   -e worktree/ignored-by-tree &&
-	test ! -e worktree/ignored-by-worktree
+test_expect_missing	worktree/ignored
+test_expect_exists	worktree/ignored-by-tree
+test_expect_missing	worktree/ignored-by-worktree
+
+test_expect_success 'git archive vs. bare' '
+	(cd bare && git archive HEAD) >bare-archive.tar &&
+	test_cmp archive.tar bare-archive.tar
+'
+
+test_expect_success 'git archive with worktree attributes, bare' '
+	(cd bare && git archive --fix-attributes HEAD) >bare-worktree.tar &&
+	(mkdir bare-worktree && cd bare-worktree && "$TAR" xf -
+	) <bare-worktree.tar
 '
 
+test_expect_missing	bare-worktree/ignored
+test_expect_exists	bare-worktree/ignored-by-tree
+test_expect_exists	bare-worktree/ignored-by-worktree
+
 test_expect_success 'export-subst' '
 	git log "--pretty=format:A${SUBSTFORMAT}O" HEAD >substfile1.expected &&
 	test_cmp nosubstfile archive/nosubstfile &&
@@ -59,4 +84,9 @@ test_expect_success 'git tar-tree vs. git archive with worktree attributes' '
 	test_cmp worktree.tar tar-tree.tar
 '
 
+test_expect_success 'git tar-tree vs. git archive with worktree attrs, bare' '
+	(cd bare && git tar-tree HEAD) >bare-tar-tree.tar &&
+	test_cmp bare-worktree.tar bare-tar-tree.tar
+'
+
 test_done
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 19 in “archive attribute series”
  1. 0/5 archive attribute seriesJunio C Hamano, Apr 16, 2009
  2. 1/5 archive tests: do not use .gitattributes in working directoryJunio C Hamano, Apr 16, 2009
  3. 2/5 attr: add GIT_ATTR_INDEX "direction"Junio C Hamano, Apr 16, 2009
  4. 3/5 unpack-trees: do not muck with attributes when we are not checking outJunio C Hamano, Apr 16, 2009
  5. 4/5 archive: do not read .gitattributes in working directoryJunio C Hamano, Apr 16, 2009
  6. 5/5 archive test: test new --fix-attributes featureJunio C Hamano, Apr 16, 2009
  7. René ScharfeApr 17, 2009
  8. Junio C HamanoApr 16, 2009
  9. Jeff KingApr 16, 2009
  10. Jakub NarebskiApr 16, 2009
  11. Nguyen Thai Ngoc DuyApr 16, 2009
  12. Nguyen Thai Ngoc DuyApr 16, 2009
  13. René ScharfeApr 17, 2009
  14. René ScharfeApr 17, 2009
  15. 1/5 archive tests: do not use .gitattributes in working directoryRené Scharfe, Apr 17, 2009
  16. 2/5 attr: add GIT_ATTR_INDEX "direction"René Scharfe, Apr 17, 2009
  17. 3/5 unpack-trees: do not muck with attributes when we are not checking outRené Scharfe, Apr 17, 2009
  18. 4/5 archive: do not read .gitattributes in working directoryRené Scharfe, Apr 17, 2009
  19. 5/5 archive test: attributesRené Scharfe, Apr 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.