]> git.ipfire.org Git - thirdparty/git.git/commit
refs: retrieve worktree ref stores via associated repository
authorPatrick Steinhardt <ps@pks.im>
Fri, 17 May 2024 08:18:44 +0000 (10:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 17:33:38 +0000 (10:33 -0700)
commitdc7fb4f72c2e39ffbb98aee55ad7ea4c3f8e12fc
treeac6fe8d4aaff5edae0cf79545f9cdce1be9e8590
parente19488a60aab022ca4c8d32d6629c04ce94f2779
refs: retrieve worktree ref stores via associated repository

Similar as with the preceding commit, the worktree ref stores are always
looked up via `the_repository`. Also, again, those ref stores are stored
in a global map.

Refactor the code so that worktrees have a pointer to their repository.
Like this, we can move the global map into `struct repository` and stop
using `the_repository`. With this change, we can now in theory look up
worktree ref stores for repositories other than `the_repository`. In
practice, the worktree code will need further changes to look up
arbitrary worktrees.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
repository.c
repository.h
worktree.c
worktree.h