]> git.ipfire.org Git - thirdparty/git.git/commit
refs: pass repo when retrieving submodule ref store
authorPatrick Steinhardt <ps@pks.im>
Fri, 17 May 2024 08:18:34 +0000 (10:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 17:33:37 +0000 (10:33 -0700)
commit965f8991e59d84ba1b86e528f9c27852e746fa90
treed0bda938d26417375738c48d67edade1a11bfce5
parentf1782d185b03db37412f47a013400b0693fd97bd
refs: pass repo when retrieving submodule ref store

Looking up submodule ref stores has two deficiencies:

  - The initialized subrepo will be attributed to `the_repository`.

  - The submodule ref store will be tracked in a global map.

This makes it impossible to have submodule ref stores for a repository
other than `the_repository`.

Modify the function to accept the parent repository as parameter and
move the global map into `struct repository`. Like this it becomes
possible to look up submodule ref stores for arbitrary repositories.

Note that this also adds a new reference to `the_repository` in
`resolve_gitlink_ref()`, which is part of the refs interfaces. This will
get adjusted in the next patch.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
refs.c
refs.h
refs/refs-internal.h
repository.c
repository.h
submodule.c
t/helper/test-ref-store.c