Skip to content

Commit 0795805

Browse files
aspiersgitster
authored andcommitted
dir.c: rename excluded_from_list() to is_excluded_from_list()
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 Also adjust their callers as necessary. Signed-off-by: Adam Spiers <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9013089 commit 0795805

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

dir.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,9 @@ int match_pathname(const char *pathname, int pathlen,
605605
/* Scan the list and let the last match determine the fate.
606606
* Return 1 for exclude, 0 for include and -1 for undecided.
607607
*/
608-
int excluded_from_list(const char *pathname,
609-
int pathlen, const char *basename, int *dtype,
610-
struct exclude_list *el)
608+
int is_excluded_from_list(const char *pathname,
609+
int pathlen, const char *basename, int *dtype,
610+
struct exclude_list *el)
611611
{
612612
int i;
613613

@@ -654,8 +654,9 @@ static int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p)
654654

655655
prep_exclude(dir, pathname, basename-pathname);
656656
for (st = EXC_CMDL; st <= EXC_FILE; st++) {
657-
switch (excluded_from_list(pathname, pathlen, basename,
658-
dtype_p, &dir->exclude_list[st])) {
657+
switch (is_excluded_from_list(pathname, pathlen,
658+
basename, dtype_p,
659+
&dir->exclude_list[st])) {
659660
case 0:
660661
return 0;
661662
case 1:

dir.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ extern int within_depth(const char *name, int namelen, int depth, int max_depth)
9898
extern int fill_directory(struct dir_struct *dir, const char **pathspec);
9999
extern int read_directory(struct dir_struct *, const char *path, int len, const char **pathspec);
100100

101-
extern int excluded_from_list(const char *pathname, int pathlen, const char *basename,
102-
int *dtype, struct exclude_list *el);
101+
extern int is_excluded_from_list(const char *pathname, int pathlen, const char *basename,
102+
int *dtype, struct exclude_list *el);
103103
struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len);
104104

105105
/*

unpack-trees.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,8 @@ static int clear_ce_flags_dir(struct cache_entry **cache, int nr,
836836
{
837837
struct cache_entry **cache_end;
838838
int dtype = DT_DIR;
839-
int ret = excluded_from_list(prefix, prefix_len, basename, &dtype, el);
839+
int ret = is_excluded_from_list(prefix, prefix_len,
840+
basename, &dtype, el);
840841

841842
prefix[prefix_len++] = '/';
842843

@@ -855,7 +856,7 @@ static int clear_ce_flags_dir(struct cache_entry **cache, int nr,
855856
* with ret (iow, we know in advance the incl/excl
856857
* decision for the entire directory), clear flag here without
857858
* calling clear_ce_flags_1(). That function will call
858-
* the expensive excluded_from_list() on every entry.
859+
* the expensive is_excluded_from_list() on every entry.
859860
*/
860861
return clear_ce_flags_1(cache, cache_end - cache,
861862
prefix, prefix_len,
@@ -938,7 +939,8 @@ static int clear_ce_flags_1(struct cache_entry **cache, int nr,
938939

939940
/* Non-directory */
940941
dtype = ce_to_dtype(ce);
941-
ret = excluded_from_list(ce->name, ce_namelen(ce), name, &dtype, el);
942+
ret = is_excluded_from_list(ce->name, ce_namelen(ce),
943+
name, &dtype, el);
942944
if (ret < 0)
943945
ret = defval;
944946
if (ret > 0)

0 commit comments

Comments
 (0)