Re: [PATCH v5 02/17] sparse-checkout: create 'init' subcommand
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Nov 20, 2019, 14:13 UTC
- Message-ID
- <20191120141353.GA30837@szeder.dev>
- In-Reply-To
- <20191119143308.GF23183@szeder.dev>
On Tue, Nov 19, 2019 at 03:33:08PM +0100, SZEDER Gábor wrote:
Show 17 quoted lines
> > + argv_array_pushl(&argv, "config", "--worktree", "core.sparseCheckout", NULL);
> > +
> > + if (mode)
> > + argv_array_pushl(&argv, "true", NULL);
> > + else
> > + argv_array_pushl(&argv, "false", NULL);
> > +
> > + if (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {
> > + error(_("failed to enable core.sparseCheckout"));
> > + return 1;
> > + }
>
> Why the external 'git config' invocation?
>
> git_config_set_in_file_gently(git_path("config.worktree"),
> "core.sparseCheckout",
> mode ? "true" : "false")Having slept on it, I think it would be even better to pass NULL instead of "false". "false", well, just sets the configuration variable to false, but a NULL would properly unset it.