diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2021-10-08 21:08:16 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-08 22:06:06 (GMT) |
commit | 8788195c8846be949e6cd4bd19c8dc5e6371ffd3 (patch) | |
tree | 083f441572e55b2726e2bea2bad031ef317278a6 /refs/files-backend.c | |
parent | 9bc45a28026eaea42011e8c1884aa2d9dc30f947 (diff) | |
download | git-8788195c8846be949e6cd4bd19c8dc5e6371ffd3.zip git-8788195c8846be949e6cd4bd19c8dc5e6371ffd3.tar.gz git-8788195c8846be949e6cd4bd19c8dc5e6371ffd3.tar.bz2 |
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/files-backend.c')
-rw-r--r-- | refs/files-backend.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 3f213d2..8ee6ac2 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -833,7 +833,7 @@ static struct ref_iterator *files_ref_iterator_begin( */ loose_iter = cache_ref_iterator_begin(get_loose_ref_cache(refs), - prefix, 1); + prefix, ref_store->repo, 1); /* * The packed-refs file might contain broken references, for @@ -1165,7 +1165,8 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags) packed_refs_lock(refs->packed_ref_store, LOCK_DIE_ON_ERROR, &err); - iter = cache_ref_iterator_begin(get_loose_ref_cache(refs), NULL, 0); + iter = cache_ref_iterator_begin(get_loose_ref_cache(refs), NULL, + the_repository, 0); while ((ok = ref_iterator_advance(iter)) == ITER_OK) { /* * If the loose reference can be packed, add an entry |