summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2012-12-27 02:32:21 +0000
committerJunio C Hamano <gitster@pobox.com>2012-12-28 12:07:45 -0800
commit95a68344afcaf229765921c70458ee76add342dc (patch)
tree7d70e44472e4f344214b6819d209c724e778fa4c /dir.c
parentf1a7082f2a05b6b187fad9c661e2c872f8b477f5 (diff)
downloadgit-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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index ee8e7115a8..89e27a6825 100644
--- a/dir.c
+++ b/dir.c
@@ -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 &&