From: Thomas Gummerer Date: Tue, 10 Dec 2013 18:55:33 GMT Subject: Re: [PATCH v3 2/2] diff: don't read index when --no-index is given Message-ID: <87bo0omt7e.fsf@gmail.com> In-Reply-To: <20131210181840.GC2311@google.com> Jonathan Nieder writes: > Thomas Gummerer wrote: > >> --- a/builtin/diff.c >> +++ b/builtin/diff.c >> @@ -295,7 +295,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix) >> break; >> } >> >> - prefix = setup_git_directory_gently(&nongit); >> + if (!no_index) >> + prefix = setup_git_directory_gently(&nongit); > > What is the value of nongit in the no_index case? In the no_index case it doesn't matter, since no_index is always checked first. The only other place where it is used, when no_index is set is after diff_no_index, which can't be reached if no_index is set. I could initialize nongit to 0, but I don't think that would change anything. I've also seen that the no_index and nongit parameters to diff_no_index are not needed anymore, and will remove them in the re-roll therefore. I'll wait to see if there are any more comments and then send a re-roll. Thanks! -- Thomas