提交 9013089c 编写于 作者: A Adam Spiers 提交者: Junio C Hamano

dir.c: rename path_excluded() to is_path_excluded()

Start adopting clearer names for exclude functions.  This 'is_*'
naming pattern for functions returning booleans was agreed here:

http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924Signed-off-by: NAdam Spiers <git@adamspiers.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 840fc334
...@@ -453,7 +453,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) ...@@ -453,7 +453,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
&& !file_exists(pathspec[i])) { && !file_exists(pathspec[i])) {
if (ignore_missing) { if (ignore_missing) {
int dtype = DT_UNKNOWN; int dtype = DT_UNKNOWN;
if (path_excluded(&check, pathspec[i], -1, &dtype)) if (is_path_excluded(&check, pathspec[i], -1, &dtype))
dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i])); dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
} else } else
die(_("pathspec '%s' did not match any files"), die(_("pathspec '%s' did not match any files"),
......
...@@ -203,7 +203,7 @@ static void show_ru_info(void) ...@@ -203,7 +203,7 @@ static void show_ru_info(void)
static int ce_excluded(struct path_exclude_check *check, struct cache_entry *ce) static int ce_excluded(struct path_exclude_check *check, struct cache_entry *ce)
{ {
int dtype = ce_to_dtype(ce); int dtype = ce_to_dtype(ce);
return path_excluded(check, ce->name, ce_namelen(ce), &dtype); return is_path_excluded(check, ce->name, ce_namelen(ce), &dtype);
} }
static void show_files(struct dir_struct *dir) static void show_files(struct dir_struct *dir)
......
...@@ -685,7 +685,7 @@ void path_exclude_check_clear(struct path_exclude_check *check) ...@@ -685,7 +685,7 @@ void path_exclude_check_clear(struct path_exclude_check *check)
* A path to a directory known to be excluded is left in check->path to * A path to a directory known to be excluded is left in check->path to
* optimize for repeated checks for files in the same excluded directory. * optimize for repeated checks for files in the same excluded directory.
*/ */
int path_excluded(struct path_exclude_check *check, int is_path_excluded(struct path_exclude_check *check,
const char *name, int namelen, int *dtype) const char *name, int namelen, int *dtype)
{ {
int i; int i;
......
...@@ -123,7 +123,7 @@ struct path_exclude_check { ...@@ -123,7 +123,7 @@ struct path_exclude_check {
}; };
extern void path_exclude_check_init(struct path_exclude_check *, struct dir_struct *); extern void path_exclude_check_init(struct path_exclude_check *, struct dir_struct *);
extern void path_exclude_check_clear(struct path_exclude_check *); extern void path_exclude_check_clear(struct path_exclude_check *);
extern int path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype); extern int is_path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype);
extern int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen, extern int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen,
......
...@@ -1372,7 +1372,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype, ...@@ -1372,7 +1372,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
return 0; return 0;
if (o->dir && if (o->dir &&
path_excluded(o->path_exclude_check, name, -1, &dtype)) is_path_excluded(o->path_exclude_check, name, -1, &dtype))
/* /*
* ce->name is explicitly excluded, so it is Ok to * ce->name is explicitly excluded, so it is Ok to
* overwrite it. * overwrite it.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册