Merge branch 'nd/maint-fix-add-typo-detection'
* nd/maint-fix-add-typo-detection: Revert "excluded_1(): support exclude files in index" unpack-trees: fix sparse checkout's "unable to match directories" unpack-trees: move all skip-worktree checks back to unpack_trees() dir.c: add free_excludes() cache.h: realign and use (1 << x) form for CE_* constants
This commit is contained in:
19
dir.c
19
dir.c
@ -253,6 +253,18 @@ static void *read_skip_worktree_file_from_index(const char *path, size_t *size)
|
||||
return data;
|
||||
}
|
||||
|
||||
void free_excludes(struct exclude_list *el)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < el->nr; i++)
|
||||
free(el->excludes[i]);
|
||||
free(el->excludes);
|
||||
|
||||
el->nr = 0;
|
||||
el->excludes = NULL;
|
||||
}
|
||||
|
||||
int add_excludes_from_file_to_list(const char *fname,
|
||||
const char *base,
|
||||
int baselen,
|
||||
@ -389,13 +401,6 @@ int excluded_from_list(const char *pathname,
|
||||
int to_exclude = x->to_exclude;
|
||||
|
||||
if (x->flags & EXC_FLAG_MUSTBEDIR) {
|
||||
if (!dtype) {
|
||||
if (!prefixcmp(pathname, exclude) &&
|
||||
pathname[x->patternlen] == '/')
|
||||
return to_exclude;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
if (*dtype == DT_UNKNOWN)
|
||||
*dtype = get_dtype(NULL, pathname, pathlen);
|
||||
if (*dtype != DT_DIR)
|
||||
|
Reference in New Issue
Block a user