diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2021-10-08 23:08:16 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-09 00:06:06 +0200 |
commit | 8788195c8846be949e6cd4bd19c8dc5e6371ffd3 (patch) | |
tree | 083f441572e55b2726e2bea2bad031ef317278a6 /refs/packed-backend.c | |
parent | refs: teach arbitrary repo support to iterators (diff) | |
download | git-8788195c8846be949e6cd4bd19c8dc5e6371ffd3.tar.xz git-8788195c8846be949e6cd4bd19c8dc5e6371ffd3.zip |
refs: peeling non-the_repository iterators is BUG
There is currently no support for peeling the current ref of an iterator
iterating over a non-the_repository ref store, and none is needed. Thus,
for now, BUG() if that happens.
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 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/refs/packed-backend.c b/refs/packed-backend.c index 63f78bbaea..2161218719 100644 --- a/refs/packed-backend.c +++ b/refs/packed-backend.c @@ -886,6 +886,9 @@ static int packed_ref_iterator_peel(struct ref_iterator *ref_iterator, struct packed_ref_iterator *iter = (struct packed_ref_iterator *)ref_iterator; + if (iter->repo != the_repository) + BUG("peeling for non-the_repository is not supported"); + if ((iter->base.flags & REF_KNOWS_PEELED)) { oidcpy(peeled, &iter->peeled); return is_null_oid(&iter->peeled) ? -1 : 0; |