From: Junio C Hamano Date: Mon, 13 Jul 2026 16:39:46 GMT Subject: Re: [PATCH v11 06/10] environment: migrate apply_default_whitespace and apply_default_ignorewhitespace Message-ID: In-Reply-To: <20260713035738.1606138-7-cat@malon.dev> Tian Yuchen writes: > Subject: Re: [PATCH v11 06/10] environment: migrate apply_default_whitespace and apply_default_ignorewhitespace Are there patches 7..10/10 posted somewhere else? I didn't see them in the thread (neither did "b4"). > > -static void git_apply_config(void) > +static void git_apply_config(struct repository *repo) > { > - repo_config_get_string(the_repository, "apply.whitespace", &apply_default_whitespace); > - repo_config_get_string(the_repository, "apply.ignorewhitespace", &apply_default_ignorewhitespace); > - repo_config(the_repository, git_xmerge_config, NULL); > + struct repo_config_values *cfg = repo_config_values(repo); > + > + FREE_AND_NULL(cfg->apply_default_whitespace); > + repo_config_get_string(repo, "apply.whitespace", > + &cfg->apply_default_whitespace); > + FREE_AND_NULL(cfg->apply_default_ignorewhitespace); > + repo_config_get_string(repo, "apply.ignorewhitespace", > + &cfg->apply_default_ignorewhitespace); > + repo_config(repo, git_xmerge_config, NULL); > } OK. > static int parse_whitespace_option(struct apply_state *state, const char *option) > @@ -126,10 +132,15 @@ int init_apply_state(struct apply_state *state, > strset_init(&state->kept_symlinks); > strbuf_init(&state->root, 0); > > - git_apply_config(); > - if (apply_default_whitespace && parse_whitespace_option(state, apply_default_whitespace)) > + git_apply_config(repo); > + > + struct repo_config_values *cfg = repo_config_values(repo); Doesn't "-Wdeclaration-after-statement" complain on this, declaring cfg after calling "git_apply_config(repo)" on the line before?