diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-04-01 03:49:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-14 22:46:00 +0200 |
commit | 847a9e5d4f876646e128c89f0818b1a8ce792509 (patch) | |
tree | dc3a36fbfcc5d0384093da4bc75bef39f4b73bac /pathspec.c | |
parent | sparse-index: API protection strategy (diff) | |
download | git-847a9e5d4f876646e128c89f0818b1a8ce792509.tar.xz git-847a9e5d4f876646e128c89f0818b1a8ce792509.zip |
*: remove 'const' qualifier for struct index_state
Several methods specify that they take a 'struct index_state' pointer
with the 'const' qualifier because they intend to only query the data,
not change it. However, we will be introducing a step very low in the
method stack that might modify a sparse-index to become a full index in
the case that our queries venture inside a sparse-directory entry.
This change only removes the 'const' qualifiers that are necessary for
the following change which will actually modify the implementation of
index_name_stage_pos().
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
-rw-r--r-- | pathspec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pathspec.c b/pathspec.c index 7a229d8d22..b6e333965c 100644 --- a/pathspec.c +++ b/pathspec.c @@ -20,7 +20,7 @@ * to use find_pathspecs_matching_against_index() instead. */ void add_pathspec_matches_against_index(const struct pathspec *pathspec, - const struct index_state *istate, + struct index_state *istate, char *seen) { int num_unmatched = 0, i; @@ -51,7 +51,7 @@ void add_pathspec_matches_against_index(const struct pathspec *pathspec, * given pathspecs achieves against all items in the index. */ char *find_pathspecs_matching_against_index(const struct pathspec *pathspec, - const struct index_state *istate) + struct index_state *istate) { char *seen = xcalloc(pathspec->nr, 1); add_pathspec_matches_against_index(pathspec, istate, seen); @@ -702,7 +702,7 @@ void clear_pathspec(struct pathspec *pathspec) pathspec->nr = 0; } -int match_pathspec_attrs(const struct index_state *istate, +int match_pathspec_attrs(struct index_state *istate, const char *name, int namelen, const struct pathspec_item *item) { |