Re: [PATCH v2 10/24] t/helper: initialize repository if necessary

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

 



On 2020-02-24 at 18:05:55, Junio C Hamano wrote:
> "brian m. carlson" <sandals@xxxxxxxxxxxxxxxxxxxx> writes:
> > diff --git a/t/helper/test-repository.c b/t/helper/test-repository.c
> > index f7f8618445..ecc768e4cb 100644
> > --- a/t/helper/test-repository.c
> > +++ b/t/helper/test-repository.c
> > @@ -75,6 +75,10 @@ static void test_get_commit_tree_in_graph(const char *gitdir,
> >  
> >  int cmd__repository(int argc, const char **argv)
> >  {
> > +	int nongit_ok = 0;
> > +
> > +	setup_git_directory_gently(&nongit_ok);
> 
> No need to initialize nongit_ok to any specific value before calling
> setup_git_directory_gently() and I personally find this initialization
> unhelpful to new readers, as it misleadingly hints the setup process
> may be affected by the value passed in by the value in nongit_ok,
> when in reality the variable is purely used as outout-only (the
> first thing the function does is to clear it).
> 
> Was it necessary to work around a compiler warning or something?

I don't recall, but since this seems to be the only place we do that, I
assume it's not, and I'll just drop it.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[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