diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-05-08 10:18:44 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-08 10:18:44 -0700 |
| commit | f526a4f3142de772bdd2d0dbd4710e401f603a5c (patch) | |
| tree | ba224ae569501c086acff8e8db3896aefa56fd3d /builtin/check-ignore.c | |
| parent | c5c9acf77d9bced87c758e8c8aba13a438d34802 (diff) | |
| parent | 0c473557908ec626e9e8abf66d2f2308624cdd14 (diff) | |
| download | git-f526a4f3142de772bdd2d0dbd4710e401f603a5c.tar.gz | |
Merge branch 'ps/the-index-is-no-more'
The singleton index_state instance "the_index" has been eliminated
by always instantiating "the_repository" and replacing references
to "the_index" with references to its .index member.
* ps/the-index-is-no-more:
repository: drop `initialize_the_repository()`
repository: drop `the_index` variable
builtin/clone: stop using `the_index`
repository: initialize index in `repo_init()`
builtin: stop using `the_index`
t/helper: stop using `the_index`
Diffstat (limited to 'builtin/check-ignore.c')
| -rw-r--r-- | builtin/check-ignore.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c index 906cd96753..6c43430ec4 100644 --- a/builtin/check-ignore.c +++ b/builtin/check-ignore.c @@ -1,4 +1,3 @@ -#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "config.h" #include "dir.h" @@ -95,21 +94,21 @@ static int check_ignore(struct dir_struct *dir, PATHSPEC_KEEP_ORDER, prefix, argv); - die_path_inside_submodule(&the_index, &pathspec); + die_path_inside_submodule(the_repository->index, &pathspec); /* * look for pathspecs matching entries in the index, since these * should not be ignored, in order to be consistent with * 'git status', 'git add' etc. */ - seen = find_pathspecs_matching_against_index(&pathspec, &the_index, + seen = find_pathspecs_matching_against_index(&pathspec, the_repository->index, PS_HEED_SKIP_WORKTREE); for (i = 0; i < pathspec.nr; i++) { full_path = pathspec.items[i].match; pattern = NULL; if (!seen[i]) { int dtype = DT_UNKNOWN; - pattern = last_matching_pattern(dir, &the_index, + pattern = last_matching_pattern(dir, the_repository->index, full_path, &dtype); if (!verbose && pattern && pattern->flags & PATTERN_FLAG_NEGATIVE) |
