On Sat, Aug 19, 2017 at 9:53 AM, René Scharfe <l.s.r@xxxxxx> wrote: > Am 19.08.2017 um 07:33 schrieb René Scharfe: >> When read_tree_recursive() encounters a directory excluded by a pathspec >> then it enters it anyway because it might contain included entries. It >> calls the callback function before it is able to decide if the directory >> is actually needed. >> >> For that reason git archive adds directories to a queue and writes >> entries for them only when it encounters the first child item -- but >> only if pathspecs with wildcards are used. Do the same for literal >> pathspecs as well, as the reasoning above applies to them, too. This >> prevents git archive from writing entries for excluded directories. > > This breaks the test "archive empty subtree with no pathspec" in t5004 by > omitting the empty directory from the archive. Sorry for missing that! > > This is kind of a bonus patch, so please discard it for now; the first > three are OK IMHO. I thought so up to reading this patch. I found the naming and content of should_queue_directories not obvious at first read. This patch confused me even more for that name to be chosen. I have no alternative to propose, though. Thanks, Stefan