Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-08 01:21:15 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-08 01:27:28 +0300
commit0ad927e9e0013471cc752781f0c368f862934a44 (patch)
treec11565bf069a6b54a84028aa125b0f59e39fe71c /tree-walk.c
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3 (diff)
tree-walk: lose base_offset that is never used in tree_entry_interesting
The tree_entry_interesting() function takes base_offset, allowing its callers to potentially pass a non-zero number to skip the early part of the path string. The feature is never exercised and we do not even know what bugs are lurking there, as all callers pass 0 to the parameter. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.c')
-rw-r--r--tree-walk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tree-walk.c b/tree-walk.c
index d3c48e06df..28d59936ad 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -435,7 +435,7 @@ static inline int prune_traversal(struct index_state *istate,
if (still_interesting < 0)
return still_interesting;
return tree_entry_interesting(istate, e, base,
- 0, info->pathspec);
+ info->pathspec);
}
int traverse_trees(struct index_state *istate,
@@ -1223,10 +1223,11 @@ interesting:
*/
enum interesting tree_entry_interesting(struct index_state *istate,
const struct name_entry *entry,
- struct strbuf *base, int base_offset,
+ struct strbuf *base,
const struct pathspec *ps)
{
enum interesting positive, negative;
+ const int base_offset = 0;
positive = do_match(istate, entry, base, base_offset, ps, 0);
/*