Subject: Re: [PATCH v3 2/2] diff: don't read index when --no-index is given

From: Thomas Gummerer <[email-masked]>
Date: Tue, 10 Dec 2013 19:55:33 +0100

Jonathan Nieder <[email-masked]> 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