Skip to content

Commit eef8148

Browse files
derrickstoleegitster
authored andcommitted
dir: update stale description of treat_directory()
The documentation comment for treat_directory() was originally written in 095952 (Teach directory traversal about subprojects, 2007-04-11) which was before the 'struct dir_struct' split its bitfield of named options into a 'flags' enum in 7c4c97c (Turn the flags in struct dir_struct into a single variable, 2009-02-16). When those flags changed, the comment became stale, since members like 'show_other_directories' transitioned into flags like DIR_SHOW_OTHER_DIRECTORIES. Update the comments for treat_directory() to use these flag names rather than the old member names. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c9f1bf commit eef8148

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

dir.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,13 +1740,13 @@ static enum exist_status directory_exists_in_index(struct index_state *istate,
17401740
* Case 3: if we didn't have it in the index previously, we
17411741
* have a few sub-cases:
17421742
*
1743-
* (a) if "show_other_directories" is true, we show it as
1744-
* just a directory, unless "hide_empty_directories" is
1743+
* (a) if DIR_SHOW_OTHER_DIRECTORIES flag is set, we show it as
1744+
* just a directory, unless DIR_HIDE_EMPTY_DIRECTORIES is
17451745
* also true, in which case we need to check if it contains any
17461746
* untracked and / or ignored files.
1747-
* (b) if it looks like a git directory, and we don't have
1748-
* 'no_gitlinks' set we treat it as a gitlink, and show it
1749-
* as a directory.
1747+
* (b) if it looks like a git directory and we don't have the
1748+
* DIR_NO_GITLINKS flag, then we treat it as a gitlink, and
1749+
* show it as a directory.
17501750
* (c) otherwise, we recurse into it.
17511751
*/
17521752
static enum path_treatment treat_directory(struct dir_struct *dir,
@@ -1834,7 +1834,6 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
18341834
return path_recurse;
18351835
}
18361836

1837-
/* This is the "show_other_directories" case */
18381837
assert(dir->flags & DIR_SHOW_OTHER_DIRECTORIES);
18391838

18401839
/*
@@ -1849,7 +1848,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
18491848
/* Special cases for where this directory is excluded/ignored */
18501849
if (excluded) {
18511850
/*
1852-
* In the show_other_directories case, if we're not
1851+
* If DIR_SHOW_OTHER_DIRECTORIES is set and we're not
18531852
* hiding empty directories, there is no need to
18541853
* recurse into an ignored directory.
18551854
*/

0 commit comments

Comments
 (0)