diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2021-10-08 23:08:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-09 00:06:05 +0200 |
commit | 9bc45a28026eaea42011e8c1884aa2d9dc30f947 (patch) | |
tree | 96ebd3f3bfb706e4d534bbf0de7f9223fddf32f3 /refs/packed-backend.c | |
parent | refs: plumb repo into ref stores (diff) | |
download | git-9bc45a28026eaea42011e8c1884aa2d9dc30f947.tar.xz git-9bc45a28026eaea42011e8c1884aa2d9dc30f947.zip |
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.c | 6 |
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) |