Skip to content

Commit 9013089

Browse files
aspiersgitster
authored andcommitted
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=204924 Signed-off-by: Adam Spiers <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 840fc33 commit 9013089

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
453453
&& !file_exists(pathspec[i])) {
454454
if (ignore_missing) {
455455
int dtype = DT_UNKNOWN;
456-
if (path_excluded(&check, pathspec[i], -1, &dtype))
456+
if (is_path_excluded(&check, pathspec[i], -1, &dtype))
457457
dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
458458
} else
459459
die(_("pathspec '%s' did not match any files"),

builtin/ls-files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static void show_ru_info(void)
203203
static int ce_excluded(struct path_exclude_check *check, struct cache_entry *ce)
204204
{
205205
int dtype = ce_to_dtype(ce);
206-
return path_excluded(check, ce->name, ce_namelen(ce), &dtype);
206+
return is_path_excluded(check, ce->name, ce_namelen(ce), &dtype);
207207
}
208208

209209
static void show_files(struct dir_struct *dir)

dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,8 @@ void path_exclude_check_clear(struct path_exclude_check *check)
685685
* A path to a directory known to be excluded is left in check->path to
686686
* optimize for repeated checks for files in the same excluded directory.
687687
*/
688-
int path_excluded(struct path_exclude_check *check,
689-
const char *name, int namelen, int *dtype)
688+
int is_path_excluded(struct path_exclude_check *check,
689+
const char *name, int namelen, int *dtype)
690690
{
691691
int i;
692692
struct strbuf *path = &check->path;

dir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct path_exclude_check {
123123
};
124124
extern void path_exclude_check_init(struct path_exclude_check *, struct dir_struct *);
125125
extern void path_exclude_check_clear(struct path_exclude_check *);
126-
extern int path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype);
126+
extern int is_path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype);
127127

128128

129129
extern int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen,

unpack-trees.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
13721372
return 0;
13731373

13741374
if (o->dir &&
1375-
path_excluded(o->path_exclude_check, name, -1, &dtype))
1375+
is_path_excluded(o->path_exclude_check, name, -1, &dtype))
13761376
/*
13771377
* ce->name is explicitly excluded, so it is Ok to
13781378
* overwrite it.

0 commit comments

Comments
 (0)