summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32f54ca)
raw | patch | inline | side by side (parent: 32f54ca)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 20 Aug 2009 13:47:03 +0000 (20:47 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Aug 2009 00:13:33 +0000 (17:13 -0700) |
Index does not really have "directories", attempts to match "foo/"
against index will fail unless someone tries to reconstruct directories
from a list of file.
Observing that dtype in this function can never be NULL (otherwise
it would segfault), dtype NULL will be used to say "hey.. you are
matching against index" and behave properly.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
against index will fail unless someone tries to reconstruct directories
from a list of file.
Observing that dtype in this function can never be NULL (otherwise
it would segfault), dtype NULL will be used to say "hey.. you are
matching against index" and behave properly.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c | patch | blob | history |
index e8e5b7917d6207139c78b5c18b0e918aa55772bd..7735cea6316ead9e2827d1ddc7a49d5b36a4f65c 100644 (file)
--- a/dir.c
+++ b/dir.c
int to_exclude = x->to_exclude;
if (x->flags & EXC_FLAG_MUSTBEDIR) {
+ if (!dtype) {
+ if (!prefixcmp(pathname, exclude))
+ return to_exclude;
+ else
+ continue;
+ }
if (*dtype == DT_UNKNOWN)
*dtype = get_dtype(NULL, pathname, pathlen);
if (*dtype != DT_DIR)