Re: [PATCH 0/3] Use default values from settings instead of config
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Sep 13, 2021, 19:19 UTC
- Message-ID
- <YT+kJ5jhzn6rghc9@nand.local>
- In-Reply-To
- <20210913181221.42635-1-chooglen@google.com>
On Mon, Sep 13, 2021 at 11:12:18AM -0700, Glen Choo wrote:
> I'm fairly new to the codebase (this is my first patch!), so I have some > questions/concerns that I wasn't able to figure out:
Welcome to the Git community! :-).
> - prepare_repo_settings() may have undesirable side effects or may > not always be callable
Calling prepare_repo_settings() is definitely the right thing to do, because (as you note) it centralizes the default values for settings that it keeps track of.
You can call prepare_repo_settings() so long as you have a repository to call it on. Since fsck and gc must run inside of a repository, the callers you added are safe. And note that prepare_repo_settings() is idempotent, i.e., that it is a noop when called more than once.
Thanks, Taylor