Re: [PATCH 03/10] run-command API: add and use a run_command_l_opt()

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

 



On Fri, Oct 14, 2022 at 11:40:27AM -0700, Junio C Hamano wrote:

> > @@ -862,11 +858,11 @@ static void write_refspec_config(const char *src_ref_prefix,
> >  
> >  static void dissociate_from_references(void)
> >  {
> > -	static const char* argv[] = { "repack", "-a", "-d", NULL };
> 
> Good to see that this one in a wrong scope can now go away.

It definitely is broader scope than is necessary. I wonder if it makes
things easier to read, though, the way we would sometimes hoist things
out of a function into a static-global to make them more obvious. I
dunno.

> >  	char *alternates = git_pathdup("objects/info/alternates");
> >  
> >  	if (!access(alternates, F_OK)) {
> > -		if (run_command_v_opt(argv, RUN_GIT_CMD|RUN_COMMAND_NO_STDIN))
> > +		if (run_command_l_opt(RUN_GIT_CMD|RUN_COMMAND_NO_STDIN,
> > +				      "repack",  "-a", "-d", NULL))
> >  			die(_("cannot repack to clean up"));

I just happened to notice in this one there is a weird extra space
before "-a".

-Peff



[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