dir.c: rename cryptic 'which' variable to more consistent name
'el' is only *slightly* less cryptic, but is already used as the variable name for a struct exclude_list pointer in numerous other places, so this reduces the number of cryptic variable names in use by one :-) Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
95a68344af
commit
840fc334e9
10
dir.c
10
dir.c
@ -349,7 +349,7 @@ void parse_exclude_pattern(const char **pattern,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void add_exclude(const char *string, const char *base,
|
void add_exclude(const char *string, const char *base,
|
||||||
int baselen, struct exclude_list *which)
|
int baselen, struct exclude_list *el)
|
||||||
{
|
{
|
||||||
struct exclude *x;
|
struct exclude *x;
|
||||||
int patternlen;
|
int patternlen;
|
||||||
@ -373,8 +373,8 @@ void add_exclude(const char *string, const char *base,
|
|||||||
x->base = base;
|
x->base = base;
|
||||||
x->baselen = baselen;
|
x->baselen = baselen;
|
||||||
x->flags = flags;
|
x->flags = flags;
|
||||||
ALLOC_GROW(which->excludes, which->nr + 1, which->alloc);
|
ALLOC_GROW(el->excludes, el->nr + 1, el->alloc);
|
||||||
which->excludes[which->nr++] = x;
|
el->excludes[el->nr++] = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *read_skip_worktree_file_from_index(const char *path, size_t *size)
|
static void *read_skip_worktree_file_from_index(const char *path, size_t *size)
|
||||||
@ -416,7 +416,7 @@ int add_excludes_from_file_to_list(const char *fname,
|
|||||||
const char *base,
|
const char *base,
|
||||||
int baselen,
|
int baselen,
|
||||||
char **buf_p,
|
char **buf_p,
|
||||||
struct exclude_list *which,
|
struct exclude_list *el,
|
||||||
int check_index)
|
int check_index)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -463,7 +463,7 @@ int add_excludes_from_file_to_list(const char *fname,
|
|||||||
if (buf[i] == '\n') {
|
if (buf[i] == '\n') {
|
||||||
if (entry != buf + i && entry[0] != '#') {
|
if (entry != buf + i && entry[0] != '#') {
|
||||||
buf[i - (i && buf[i-1] == '\r')] = 0;
|
buf[i - (i && buf[i-1] == '\r')] = 0;
|
||||||
add_exclude(entry, base, baselen, which);
|
add_exclude(entry, base, baselen, el);
|
||||||
}
|
}
|
||||||
entry = buf + i + 1;
|
entry = buf + i + 1;
|
||||||
}
|
}
|
||||||
|
4
dir.h
4
dir.h
@ -127,11 +127,11 @@ extern int path_excluded(struct path_exclude_check *, const char *, int namelen,
|
|||||||
|
|
||||||
|
|
||||||
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,
|
||||||
char **buf_p, struct exclude_list *which, int check_index);
|
char **buf_p, struct exclude_list *el, int check_index);
|
||||||
extern void add_excludes_from_file(struct dir_struct *, const char *fname);
|
extern void add_excludes_from_file(struct dir_struct *, const char *fname);
|
||||||
extern void parse_exclude_pattern(const char **string, int *patternlen, int *flags, int *nowildcardlen);
|
extern void parse_exclude_pattern(const char **string, int *patternlen, int *flags, int *nowildcardlen);
|
||||||
extern void add_exclude(const char *string, const char *base,
|
extern void add_exclude(const char *string, const char *base,
|
||||||
int baselen, struct exclude_list *which);
|
int baselen, struct exclude_list *el);
|
||||||
extern void free_excludes(struct exclude_list *el);
|
extern void free_excludes(struct exclude_list *el);
|
||||||
extern int file_exists(const char *);
|
extern int file_exists(const char *);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user