diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-10-26 02:06:56 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-26 02:06:56 +0300 |
commit | 162a13b855ee8d920a31d6d1e928cef0f0a18e18 (patch) | |
tree | c1bfa439f65e07a38957a665c31cbe4dcdcb0b1a /refs/ref-cache.c | |
parent | bfa646c2cbad55cf652344415616eadc9e20f3c4 (diff) | |
parent | 71ef66d7403c05a6fe8ec118431332a8919b52a2 (diff) |
Merge branch 'jt/no-abuse-alternate-odb-for-submodules'
Follow through the work to use the repo interface to access
submodule objects in-process, instead of abusing the alternate
object database interface.
* jt/no-abuse-alternate-odb-for-submodules:
submodule: trace adding submodule ODB as alternate
submodule: pass repo to check_has_commit()
object-file: only register submodule ODB if needed
merge-{ort,recursive}: remove add_submodule_odb()
refs: peeling non-the_repository iterators is BUG
refs: teach arbitrary repo support to iterators
refs: plumb repo into ref stores
Diffstat (limited to 'refs/ref-cache.c')
-rw-r--r-- | refs/ref-cache.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/refs/ref-cache.c b/refs/ref-cache.c index a5ad8a39fb4..be4aa5e0981 100644 --- a/refs/ref-cache.c +++ b/refs/ref-cache.c @@ -378,6 +378,8 @@ struct cache_ref_iterator { * on from there.) */ struct cache_ref_iterator_level *levels; + + struct repository *repo; }; static int cache_ref_iterator_advance(struct ref_iterator *ref_iterator) @@ -434,6 +436,11 @@ static int cache_ref_iterator_advance(struct ref_iterator *ref_iterator) static int cache_ref_iterator_peel(struct ref_iterator *ref_iterator, struct object_id *peeled) { + struct cache_ref_iterator *iter = + (struct cache_ref_iterator *)ref_iterator; + + if (iter->repo != the_repository) + BUG("peeling for non-the_repository is not supported"); return peel_object(ref_iterator->oid, peeled) ? -1 : 0; } @@ -456,6 +463,7 @@ static struct ref_iterator_vtable cache_ref_iterator_vtable = { struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache, const char *prefix, + struct repository *repo, int prime_dir) { struct ref_dir *dir; @@ -490,5 +498,7 @@ struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache, level->prefix_state = PREFIX_CONTAINS_DIR; } + iter->repo = repo; + return ref_iterator; } |