mirror of
https://github.com/git/git.git
synced 2026-03-28 01:20:11 +01:00
pathspec: convert find_pathspecs_matching_against_index to take an index
Convert find_pathspecs_matching_against_index to take an index parameter. In addition mark pathspec.c with NO_THE_INDEX_COMPATIBILITY_MACROS now that it doesn't use any cache macros or reference 'the_index'. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2249d4dbc1
commit
08de9151a8
@@ -136,7 +136,7 @@ static char *prune_directory(struct dir_struct *dir, struct pathspec *pathspec,
|
||||
*dst++ = entry;
|
||||
}
|
||||
dir->nr = dst - dir->entries;
|
||||
add_pathspec_matches_against_index(pathspec, seen);
|
||||
add_pathspec_matches_against_index(pathspec, &the_index, seen);
|
||||
return seen;
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||
int i;
|
||||
|
||||
if (!seen)
|
||||
seen = find_pathspecs_matching_against_index(&pathspec);
|
||||
seen = find_pathspecs_matching_against_index(&pathspec, &the_index);
|
||||
|
||||
/*
|
||||
* file_exists() assumes exact match
|
||||
|
||||
@@ -98,7 +98,7 @@ static int check_ignore(struct dir_struct *dir,
|
||||
* should not be ignored, in order to be consistent with
|
||||
* 'git status', 'git add' etc.
|
||||
*/
|
||||
seen = find_pathspecs_matching_against_index(&pathspec);
|
||||
seen = find_pathspecs_matching_against_index(&pathspec, &the_index);
|
||||
for (i = 0; i < pathspec.nr; i++) {
|
||||
full_path = pathspec.items[i].match;
|
||||
exclude = NULL;
|
||||
|
||||
Reference in New Issue
Block a user