Re: [PATCH v5 02/17] sparse-checkout: create 'init' subcommand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 19, 2019 at 03:33:08PM +0100, SZEDER Gábor wrote:
> > +	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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux