]> git.ipfire.org Git - thirdparty/git.git/commit - cache-tree.c
cache-tree: do not generate empty trees as a result of all i-t-a subentries
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 16 Jul 2016 05:06:27 +0000 (07:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jul 2016 20:45:33 +0000 (13:45 -0700)
commit6d6a782fbf83927212f348f91823d886c5cd6d85
treef78051522c92b67cd414291fb6436c3d7893c676
parentc041d54a741e516b5a743f4d27532e484f2a05d3
cache-tree: do not generate empty trees as a result of all i-t-a subentries

If a subdirectory contains nothing but i-t-a entries, we generate an
empty tree object and add it to its parent tree. Which is wrong. Such
a subdirectory should not be added.

Note that this has a cascading effect. If subdir 'a/b/c' contains
nothing but i-t-a entries, we ignore it. But then if 'a/b' contains
only (the non-existing) 'a/b/c', then we should ignore 'a/b' while
building 'a' too. And it goes all the way up to top directory.

Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c
t/t2203-add-intent.sh