path: root/dir.h
diff options
authorJunio C Hamano <>2008-02-01 04:23:25 (GMT)
committerJunio C Hamano <>2008-02-05 08:46:49 (GMT)
commit6831a88ac03759a8133f10ffd52ad235a081a8a3 (patch)
tree1f9dcec12142df59bcaff2200349fbef78ee4100 /dir.h
parentd6b8fc303b389b026f2bf9918f6f83041488989b (diff)
gitignore: lazily find dtype
When we process "foo/" entries in gitignore files on a system that does not have d_type member in "struct dirent", the earlier implementation ran lstat(2) separately when matching with entries that came from the command line, in-tree .gitignore files, and $GIT_DIR/info/excludes file. This optimizes it by delaying the lstat(2) call until it becomes absolutely necessary. The initial idea for this change was by Jeff King, but I optimized it further to pass pointers to around. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'dir.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.h b/dir.h
index 10d72b5..2df15de 100644
--- a/dir.h
+++ b/dir.h
@@ -68,7 +68,7 @@ extern int match_pathspec(const char **pathspec, const char *name, int namelen,
extern int read_directory(struct dir_struct *, const char *path, const char *base, int baselen, const char **pathspec);
-extern int excluded(struct dir_struct *, const char *, int);
+extern int excluded(struct dir_struct *, const char *, int *);
extern void add_excludes_from_file(struct dir_struct *, const char *fname);
extern void add_exclude(const char *string, const char *base,
int baselen, struct exclude_list *which);