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 <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Adam Spiers committed
Dec 27, 2012 at 02:32 UTC
0795805053ad89a24954684fca2e69fea2bf50b9
3 files changed
+13
-10
dir.c
+6
-5
@@ -605,9 +605,9 @@ int match_pathname(const char *pathname, int pathlen,
605
/* Scan the list and let the last match determine the fate.
606
* Return 1 for exclude, 0 for include and -1 for undecided.
607
*/
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)
611
{
612
int i;
613
@@ -654,8 +654,9 @@ static int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p)
654
655
prep_exclude(dir, pathname, basename-pathname);
656
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])) {
660
case 0:
661
return 0;
662
case 1:
dir.h
+2
-2
@@ -98,8 +98,8 @@ extern int within_depth(const char *name, int namelen, int depth, int max_depth)
98
extern int fill_directory(struct dir_struct *dir, const char **pathspec);
99
extern int read_directory(struct dir_struct *, const char *path, int len, const char **pathspec);
100
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);
103
struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len);
104
105
/*
unpack-trees.c
+5
-3
@@ -836,7 +836,8 @@ static int clear_ce_flags_dir(struct cache_entry **cache, int nr,
836
{
837
struct cache_entry **cache_end;
838
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);
841
842
prefix[prefix_len++] = '/';
843
@@ -855,7 +856,7 @@ static int clear_ce_flags_dir(struct cache_entry **cache, int nr,
856
* with ret (iow, we know in advance the incl/excl
857
* decision for the entire directory), clear flag here without
858
* 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.
860
*/
861
return clear_ce_flags_1(cache, cache_end - cache,
862
prefix, prefix_len,
@@ -938,7 +939,8 @@ static int clear_ce_flags_1(struct cache_entry **cache, int nr,
939
940
/* Non-directory */
941
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);
944
if (ret < 0)
945
ret = defval;
946
if (ret > 0)