Re: [PATCH v4 4/6] remote: remove the_repository->remote_state from static methods
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Nov 15, 2021, 18:48 UTC
- Message-ID
- <20211115184821.1079331-1-jonathantanmy@google.com>
- In-Reply-To
- <20211028183101.41013-5-chooglen@google.com>
Show 8 quoted lines
> Replace all remaining references of the_repository->remote_state in > static functions with a struct remote_state parameter. > > To do so, move read_config() calls to non-static functions and create a > family of static functions, "remotes_*", that behave like "repo_*", but > accept struct remote_state instead of struct repository. In the case > where a static function calls a non-static function, replace the > non-static function with its "remotes_*" equivalent.
In patches 2-4, the same lines have been changed a few times, so much so that I found it easier to review if I squashed 2-4 together. I'm not sure what the opinions of other reviewers are, but I think it's better if patches 2-4 were combined into one patch.
The only confusing part is the moving of read_config(), but that is described in this commit message - it's moved to the outer (non-static) functions so that the inner functions do not need to have a pointer to the repo, only to remote_state.
So, patches 2-4 look good. I think they should be combined, but I'm OK if they're left separate too.