diff options
author | Adam Spiers <git@adamspiers.org> | 2012-12-27 02:32:21 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-12-28 12:07:45 -0800 |
commit | 95a68344afcaf229765921c70458ee76add342dc (patch) | |
tree | 7d70e44472e4f344214b6819d209c724e778fa4c /dir.c | |
parent | f1a7082f2a05b6b187fad9c661e2c872f8b477f5 (diff) | |
download | git-95a68344afcaf229765921c70458ee76add342dc.tar.gz |
Improve documentation and comments regarding directory traversal API
traversal API has a few potentially confusing properties. These
comments clarify a few key aspects and will hopefully make it easier
to understand for other newcomers in the future.
Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2,6 +2,8 @@ * This handles recursive filename detection with exclude * files, index knowledge etc.. * + * See Documentation/technical/api-directory-listing.txt + * * Copyright (C) Linus Torvalds, 2005-2006 * Junio Hamano, 2005-2006 */ @@ -476,6 +478,10 @@ void add_excludes_from_file(struct dir_struct *dir, const char *fname) die("cannot use %s as an exclude file", fname); } +/* + * Loads the per-directory exclude list for the substring of base + * which has a char length of baselen. + */ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen) { struct exclude_list *el; @@ -486,7 +492,7 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen) (baselen + strlen(dir->exclude_per_dir) >= PATH_MAX)) return; /* too long a path -- ignore */ - /* Pop the ones that are not the prefix of the path being checked. */ + /* Pop the directories that are not the prefix of the path being checked. */ el = &dir->exclude_list[EXC_DIRS]; while ((stk = dir->exclude_stack) != NULL) { if (stk->baselen <= baselen && |