From 5ff247ac0cc9b2d09c8c24bd0c8df12eed94aebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 19 Aug 2017 07:32:37 +0200 Subject: archive: don't queue excluded directories Reject directories with the attribute export-ignore already while queuing them. This prevents read_tree_recursive() from descending into them and this avoids write_archive_entry() rejecting them later on, which queue_or_write_archive_entry() is not prepared for. Borrow the existing strbuf to build the full path to avoid string copies and extra allocations; just make sure we restore the original value before moving on. Keep checking any other attributes in write_archive_entry() as before, but avoid checking them twice. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- t/t5001-archive-attr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh index 063622bc71..897f6f06d5 100755 --- a/t/t5001-archive-attr.sh +++ b/t/t5001-archive-attr.sh @@ -76,7 +76,7 @@ test_expect_exists archive-pathspec/ignored-by-worktree test_expect_missing archive-pathspec/excluded-by-pathspec.d failure test_expect_missing archive-pathspec/excluded-by-pathspec.d/file -test_expect_failure 'git archive with wildcard pathspec' ' +test_expect_success 'git archive with wildcard pathspec' ' git archive HEAD ":!excluded-by-p*" >archive-pathspec-wildcard.tar && extract_tar_to_dir archive-pathspec-wildcard ' @@ -85,7 +85,7 @@ test_expect_missing archive-pathspec-wildcard/ignored test_expect_missing archive-pathspec-wildcard/ignored-by-tree test_expect_missing archive-pathspec-wildcard/ignored-by-tree.d test_expect_missing archive-pathspec-wildcard/ignored-by-tree.d/file -test_expect_exists archive-pathspec-wildcard/ignored-by-worktree failure +test_expect_exists archive-pathspec-wildcard/ignored-by-worktree test_expect_missing archive-pathspec-wildcard/excluded-by-pathspec.d test_expect_missing archive-pathspec-wildcard/excluded-by-pathspec.d/file -- cgit v1.2.3