1656
static enum path_treatment treat_directory(struct dir_struct *dir,
1657
struct index_state *istate,
1658
struct untracked_cache_dir *untracked,
1659
- const char *dirname, int len, int baselen, int exclude,
1659
+ const char *dirname, int len, int baselen, int excluded,
1660
const struct pathspec *pathspec)
1661
{
1662
int nested_repo = 0;
1679
}
1680
if (nested_repo)
1681
return ((dir->flags & DIR_SKIP_NESTED_GIT) ? path_none :
1682
- (exclude ? path_excluded : path_untracked));
1682
+ (excluded ? path_excluded : path_untracked));
1683
1684
if (dir->flags & DIR_SHOW_OTHER_DIRECTORIES)
1685
break;
1686
- if (exclude &&
1687
- (dir->flags & DIR_SHOW_IGNORED_TOO) &&
1688
- (dir->flags & DIR_SHOW_IGNORED_TOO_MODE_MATCHING)) {
1686
+ if (excluded &&
1687
+ (dir->flags & DIR_SHOW_IGNORED_TOO) &&
1688
+ (dir->flags & DIR_SHOW_IGNORED_TOO_MODE_MATCHING)) {
1689
1690
/*
1691
* This is an excluded directory and we are
1713
/* This is the "show_other_directories" case */
1714
1715
if (!(dir->flags & DIR_HIDE_EMPTY_DIRECTORIES))
1716
- return exclude ? path_excluded : path_untracked;
1716
+ return excluded ? path_excluded : path_untracked;
1717
1718
untracked = lookup_untracked(dir->untracked, untracked,
1719
dirname + baselen, len - baselen);
1723
* the directory contains any files.
1724
*/
1725
return read_directory_recursive(dir, istate, dirname, len,
1726
- untracked, 1, exclude, pathspec);
1726
+ untracked, 1, excluded, pathspec);
1727
}
1728
1729
/*
1904
int baselen,
1905
const struct pathspec *pathspec)
1906
{
1907
- int has_path_in_index, dtype, exclude;
1907
+ int has_path_in_index, dtype, excluded;
1908
enum path_treatment path_treatment;
1909
1910
if (!cdir->d_name)
1949
(directory_exists_in_index(istate, path->buf, path->len) == index_nonexistent))
1950
return path_none;
1951
1952
- exclude = is_excluded(dir, istate, path->buf, &dtype);
1952
+ excluded = is_excluded(dir, istate, path->buf, &dtype);
1953
1954
/*
1955
* Excluded? If we don't explicitly want to show
1956
* ignored files, ignore it
1957
*/
1958
- if (exclude && !(dir->flags & (DIR_SHOW_IGNORED|DIR_SHOW_IGNORED_TOO)))
1958
+ if (excluded && !(dir->flags & (DIR_SHOW_IGNORED|DIR_SHOW_IGNORED_TOO)))
1959
return path_excluded;
1960
1961
switch (dtype) {
1965
strbuf_addch(path, '/');
1966
path_treatment = treat_directory(dir, istate, untracked,
1967
path->buf, path->len,
1968
- baselen, exclude, pathspec);
1968
+ baselen, excluded, pathspec);
1969
/*
1970
* If 1) we only want to return directories that
1971
* match an exclude pattern and 2) this directory does
1974
* recurse into this directory (instead of marking the
1975
* directory itself as an ignored path).
1976
*/
1977
- if (!exclude &&
1977
+ if (!excluded &&
1978
path_treatment == path_excluded &&
1979
(dir->flags & DIR_SHOW_IGNORED_TOO) &&
1980
(dir->flags & DIR_SHOW_IGNORED_TOO_MODE_MATCHING))
1982
return path_treatment;
1983
case DT_REG:
1984
case DT_LNK:
1985
- return exclude ? path_excluded : path_untracked;
1985
+ return excluded ? path_excluded : path_untracked;
1986
}
1987
}
1988