archive: don't queue excluded directories
commit5ff247ac0cc9b2d09c8c24bd0c8df12eed94aebc
authorRené Scharfe <l.s.r@web.de>
Sat, 19 Aug 2017 05:32:37 +0000 (19 07:32 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 19 Aug 2017 07:40:25 +0000 (19 00:40 -0700)
tree3491f059ec09b1fedd756f2f76ba7c700574500e
parentc6c08f7e9a94d062fb2f90687156798e78cf8991
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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive.c
t/t5001-archive-attr.sh