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:
authorJonathan Tan <jonathantanmy@google.com>2021-10-09 00:08:15 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-09 01:06:05 +0300
commit9bc45a28026eaea42011e8c1884aa2d9dc30f947 (patch)
tree96ebd3f3bfb706e4d534bbf0de7f9223fddf32f3 /refs/packed-backend.c
parent34224e14d6b50cb04430188332362e6a0327e5ed (diff)
refs: teach arbitrary repo support to iterators
Note that should_pack_ref() is called when writing refs, which is only supported for the_repository, hence the_repository is hardcoded there. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/packed-backend.c')
-rw-r--r--refs/packed-backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index ea3493b24e..63f78bbaea 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -778,6 +778,7 @@ struct packed_ref_iterator {
struct object_id oid, peeled;
struct strbuf refname_buf;
+ struct repository *repo;
unsigned int flags;
};
@@ -866,8 +867,8 @@ static int packed_ref_iterator_advance(struct ref_iterator *ref_iterator)
continue;
if (!(iter->flags & DO_FOR_EACH_INCLUDE_BROKEN) &&
- !ref_resolves_to_object(iter->base.refname, &iter->oid,
- iter->flags))
+ !ref_resolves_to_object(iter->base.refname, iter->repo,
+ &iter->oid, iter->flags))
continue;
return ITER_OK;
@@ -956,6 +957,7 @@ static struct ref_iterator *packed_ref_iterator_begin(
iter->base.oid = &iter->oid;
+ iter->repo = ref_store->repo;
iter->flags = flags;
if (prefix && *prefix)