diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-05-17 10:18:44 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-17 10:33:38 -0700 |
| commit | dc7fb4f72c2e39ffbb98aee55ad7ea4c3f8e12fc (patch) | |
| tree | ac6fe8d4aaff5edae0cf79545f9cdce1be9e8590 /repository.h | |
| parent | e19488a60aab022ca4c8d32d6629c04ce94f2779 (diff) | |
| download | git-dc7fb4f72c2e39ffbb98aee55ad7ea4c3f8e12fc.tar.xz | |
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>
Diffstat (limited to 'repository.h')
| -rw-r--r-- | repository.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/repository.h b/repository.h index 0389df0461..4bd8969005 100644 --- a/repository.h +++ b/repository.h @@ -117,6 +117,12 @@ struct repository { struct strmap submodule_ref_stores; /* + * A strmap of ref_stores, stored by worktree id, accessible via + * `get_worktree_ref_store()`. + */ + struct strmap worktree_ref_stores; + + /* * Contains path to often used file names. */ struct repo_path_cache cached_paths; |
