diff options
author | Glen Choo <chooglen@google.com> | 2021-11-18 01:53:22 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-19 07:31:19 +0100 |
commit | fd3cb0501e175bcac042587cb7bb75e16034a5b7 (patch) | |
tree | 50bb4343708d25a77d2c57d575691634f47088a5 /repository.h | |
parent | t5516: add test case for pushing remote refspecs (diff) | |
download | git-fd3cb0501e175bcac042587cb7bb75e16034a5b7.tar.xz git-fd3cb0501e175bcac042587cb7bb75e16034a5b7.zip |
remote: move static variables into per-repository struct
remote.c does not works with non-the_repository because it stores its
state as static variables. To support non-the_repository, we can use a
per-repository struct for the remotes subsystem.
Prepare for this change by defining a struct remote_state that holds
the remotes subsystem state and move the static variables of remote.c
into the_repository->remote_state.
This introduces no behavioral or API changes.
Signed-off-by: Glen Choo <chooglen@google.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | repository.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/repository.h b/repository.h index a057653981..98f9583470 100644 --- a/repository.h +++ b/repository.h @@ -11,6 +11,7 @@ struct pathspec; struct raw_object_store; struct submodule_cache; struct promisor_remote_config; +struct remote_state; enum untracked_cache_setting { UNTRACKED_CACHE_KEEP, @@ -127,6 +128,9 @@ struct repository { */ struct index_state *index; + /* Repository's remotes and associated structures. */ + struct remote_state *remote_state; + /* Repository's current hash algorithm, as serialized on disk. */ const struct git_hash_algo *hash_algo; |