Skip to content

Commit 6d24e7a

Browse files
aspiersgitster
authored andcommitted
dir.c: rename excluded() to is_excluded()
Continue adopting clearer names for exclude functions. This is_* naming pattern for functions returning booleans was discussed here: http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924 Signed-off-by: Adam Spiers <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0795805 commit 6d24e7a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
284284
* (reading the file from top to bottom), .gitattribute of the root
285285
* directory (again, reading the file from top to bottom) down to the
286286
* current directory, and then scan the list backwards to find the first match.
287-
* This is exactly the same as what excluded() does in dir.c to deal with
287+
* This is exactly the same as what is_excluded() does in dir.c to deal with
288288
* .gitignore
289289
*/
290290

dir.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ int is_excluded_from_list(const char *pathname,
645645
return -1; /* undecided */
646646
}
647647

648-
static int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p)
648+
static int is_excluded(struct dir_struct *dir, const char *pathname, int *dtype_p)
649649
{
650650
int pathlen = strlen(pathname);
651651
int st;
@@ -695,7 +695,7 @@ int is_path_excluded(struct path_exclude_check *check,
695695
/*
696696
* we allow the caller to pass namelen as an optimization; it
697697
* must match the length of the name, as we eventually call
698-
* excluded() on the whole name string.
698+
* is_excluded() on the whole name string.
699699
*/
700700
if (namelen < 0)
701701
namelen = strlen(name);
@@ -712,7 +712,7 @@ int is_path_excluded(struct path_exclude_check *check,
712712

713713
if (ch == '/') {
714714
int dt = DT_DIR;
715-
if (excluded(check->dir, path->buf, &dt))
715+
if (is_excluded(check->dir, path->buf, &dt))
716716
return 1;
717717
}
718718
strbuf_addch(path, ch);
@@ -721,7 +721,7 @@ int is_path_excluded(struct path_exclude_check *check,
721721
/* An entry in the index; cannot be a directory with subentries */
722722
strbuf_setlen(path, 0);
723723

724-
return excluded(check->dir, name, dtype);
724+
return is_excluded(check->dir, name, dtype);
725725
}
726726

727727
static struct dir_entry *dir_entry_new(const char *pathname, int len)
@@ -1021,7 +1021,7 @@ static enum path_treatment treat_one_path(struct dir_struct *dir,
10211021
const struct path_simplify *simplify,
10221022
int dtype, struct dirent *de)
10231023
{
1024-
int exclude = excluded(dir, path->buf, &dtype);
1024+
int exclude = is_excluded(dir, path->buf, &dtype);
10251025
if (exclude && (dir->flags & DIR_COLLECT_IGNORED)
10261026
&& exclude_matches_pathspec(path->buf, path->len, simplify))
10271027
dir_add_ignored(dir, path->buf, path->len);

dir.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ extern int match_pathname(const char *, int,
113113
const char *, int, int, int);
114114

115115
/*
116-
* The excluded() API is meant for callers that check each level of leading
117-
* directory hierarchies with excluded() to avoid recursing into excluded
116+
* The is_excluded() API is meant for callers that check each level of leading
117+
* directory hierarchies with is_excluded() to avoid recursing into excluded
118118
* directories. Callers that do not do so should use this API instead.
119119
*/
120120
struct path_exclude_check {

0 commit comments

Comments
 (0)