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 <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Adam Spiers committed Dec 27, 2012 at 02:32 UTC 6d24e7a807922a5fbf1aa4d42f66e4f0a0aaa141
3 files changed +8 -8
attr.c
+1 -1
@@ -284,7 +284,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
284 * (reading the file from top to bottom), .gitattribute of the root
285 * directory (again, reading the file from top to bottom) down to the
286 * 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
288 * .gitignore
289 */
290
dir.c
+5 -5
@@ -645,7 +645,7 @@ int is_excluded_from_list(const char *pathname,
645 return -1; /* undecided */
646 }
647
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)
649 {
650 int pathlen = strlen(pathname);
651 int st;
@@ -695,7 +695,7 @@ int is_path_excluded(struct path_exclude_check *check,
695 /*
696 * we allow the caller to pass namelen as an optimization; it
697 * 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.
699 */
700 if (namelen < 0)
701 namelen = strlen(name);
@@ -712,7 +712,7 @@ int is_path_excluded(struct path_exclude_check *check,
712
713 if (ch == '/') {
714 int dt = DT_DIR;
715 - if (excluded(check->dir, path->buf, &dt))
715 + if (is_excluded(check->dir, path->buf, &dt))
716 return 1;
717 }
718 strbuf_addch(path, ch);
@@ -721,7 +721,7 @@ int is_path_excluded(struct path_exclude_check *check,
721 /* An entry in the index; cannot be a directory with subentries */
722 strbuf_setlen(path, 0);
723
724 - return excluded(check->dir, name, dtype);
724 + return is_excluded(check->dir, name, dtype);
725 }
726
727 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,
1021 const struct path_simplify *simplify,
1022 int dtype, struct dirent *de)
1023 {
1024 - int exclude = excluded(dir, path->buf, &dtype);
1024 + int exclude = is_excluded(dir, path->buf, &dtype);
1025 if (exclude && (dir->flags & DIR_COLLECT_IGNORED)
1026 && exclude_matches_pathspec(path->buf, path->len, simplify))
1027 dir_add_ignored(dir, path->buf, path->len);
dir.h
+2 -2
@@ -113,8 +113,8 @@ extern int match_pathname(const char *, int,
113 const char *, int, int, int);
114
115 /*
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
118 * directories. Callers that do not do so should use this API instead.
119 */
120 struct path_exclude_check {