remote: use remote_state parameter internally

Without changing external-facing functions, replace
the_repository->remote_state internally by adding a struct remote_state
parameter.

As a result, external-facing functions are still tied to the_repository,
but most static functions no longer reference
the_repository->remote_state. The exceptions are those that are used in
a way that depends on external-facing functions e.g. the callbacks to
remote_get_1().

Signed-off-by: Glen Choo <chooglen@google.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Glen Choo
2021-11-17 16:53:23 -08:00
committed by Junio C Hamano
parent fd3cb0501e
commit 085b98f6cd
2 changed files with 75 additions and 86 deletions

View File

@@ -52,6 +52,8 @@ struct remote_state {
struct rewrites rewrites;
struct rewrites rewrites_push;
int initialized;
};
void remote_state_clear(struct remote_state *remote_state);