Re: [PATCH 3/3] Add support for GIT_ONE_FILESYSTEM
- From
Jeff King <peff@peff.net>
- Date
- Mar 28, 2010, 12:05 UTC
- Message-ID
- <20100328120532.GA6131@coredump.intra.peff.net>
- In-Reply-To
- <20100328092253.GA17563@coredump.intra.peff.net>
On Sun, Mar 28, 2010 at 05:22:54AM -0400, Jeff King wrote:
Show 15 quoted lines
> > --- a/setup.c
> > +++ b/setup.c
> > @@ -390,6 +392,11 @@ const char *setup_git_directory_gently(int *nongit_ok)
> > * etc.
> > */
> > offset = len = strlen(cwd);
> > + if ((one_filesystem = git_env_bool("GIT_ONE_FILESYSTEM", 0))) {
> > + if (stat(".", &buf))
> > + die_errno("failed to stat '.'");
> > + current_device = buf.st_dev;
> > + }
>
> Style nit. I know you did the proper () to silence the compiler warning,
> but we usually avoid assignment-inside-conditional altogether.
> Personally I don't really care either way.Actually I take this back. It is in our CodingStyle guide, but we violate it all over the place (my grep counted 522). Perhaps it should be removed from CodingStyle.
-Peff