aboutsummaryrefslogtreecommitdiffstats
path: root/refs/refs-internal.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-10-23 09:16:18 +0200
committerJunio C Hamano <gitster@pobox.com>2025-11-04 07:32:25 -0800
commit5a5c7359f77ecd1bc4b0e172563161d602f131d3 (patch)
tree74ffff6a18cfd7cea56dbe323f965349ed2bd481 /refs/refs-internal.h
parentbuiltin/show-ref: convert to use `reference_get_peeled_oid()` (diff)
downloadgit-5a5c7359f77ecd1bc4b0e172563161d602f131d3.tar.gz
git-5a5c7359f77ecd1bc4b0e172563161d602f131d3.zip
refs: drop `current_ref_iter` hack
In preceding commits we have refactored all callers of `peel_iterated_oid()` to instead use `reference_get_peeled_oid()`. This allows us to thus get rid of the former function. Getting rid of that function is nice, but even nicer is that this also allows us to get rid of the `current_ref_iter` hack. This global variable tracked the currently-active ref iterator so that we can use it to peel an object ID. Now that the peeled object ID is propagated via `struct reference` though we don't have to depend on this hack anymore, which makes for a more robust and easier-to-understand infrastructure. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index ed749d1657..f4f845bbea 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -376,19 +376,6 @@ struct ref_iterator_vtable {
ref_iterator_release_fn *release;
};
-/*
- * current_ref_iter is a performance hack: when iterating over
- * references using the for_each_ref*() functions, current_ref_iter is
- * set to the reference iterator before calling the callback function.
- * If the callback function calls peel_ref(), then peel_ref() first
- * checks whether the reference to be peeled is the one referred to by
- * the iterator (it usually is) and if so, asks the iterator for the
- * peeled version of the reference if it is available. This avoids a
- * refname lookup in a common case. current_ref_iter is set to NULL
- * when the iteration is over.
- */
-extern struct ref_iterator *current_ref_iter;
-
struct ref_store;
/* refs backends */