Skip to content

Commit 882c8e3

Browse files
jayesh0104gitster
authored andcommitted
cache-tree: use index state repository in trace2 calls
trace2 calls in cache-tree.c use the global 'the_repository', even though cache_tree_update() has access to an explicit repository pointer via 'istate->repo'. Using the global repository can result in incorrect trace2 output when multiple repository instances are in use, as events may be attributed to the wrong repository. Use 'istate->repo' in cache_tree_update() to ensure correct repository attribution. Other call sites are left unchanged as they do not have access to a repository instance. Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 5361983 commit 882c8e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cache-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,12 @@ int cache_tree_update(struct index_state *istate, int flags)
488488
prefetch_cache_entries(istate, must_check_existence);
489489

490490
trace_performance_enter();
491-
trace2_region_enter("cache_tree", "update", the_repository);
491+
trace2_region_enter("cache_tree", "update", istate->repo);
492492
transaction = odb_transaction_begin(the_repository->objects);
493493
i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
494494
"", 0, &skip, flags);
495495
odb_transaction_commit(transaction);
496-
trace2_region_leave("cache_tree", "update", the_repository);
496+
trace2_region_leave("cache_tree", "update", istate->repo);
497497
trace_performance_leave("cache_tree_update");
498498
if (i < 0)
499499
return i;

0 commit comments

Comments
 (0)