Re: [PATCH v3 2/3] fetch: add --prefetch option

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

 



On 4/11/21 5:09 PM, Ramsay Jones wrote:> On 10/04/2021 03:03, Derrick Stolee via GitGitGadget wrote:
>> From: Derrick Stolee <dstolee@xxxxxxxxxxxxx>
>> +	for (i = 0; i < rs->nr; i++) {
>> +		struct strbuf new_dst = STRBUF_INIT;
>> +		char *old_dst;
>> +		const char *sub = NULL;
>> +
>> +		if (rs->items[i].negative)
>> +			continue;
>> +		if (!rs->items[i].dst ||
>> +		    (rs->items[i].src &&
>> +		     !strncmp(rs->items[i].src, "refs/tags/", 10))) {
>> +			int j;
>> +
>> +			free(rs->items[i].src);
>> +			free(rs->items[i].dst);
>> +
>> +			for (j = i + 1; j < rs->nr; j++) {
>> +				rs->items[j - 1] = rs->items[j];
>> +				rs->raw[j - 1] = rs->raw[j];
>> +			}
>> +			rs->nr--;
> 
> Hmm, don't you need to do 'i--;' here?
> 
> (Sorry in advance if this is nonsense, I am just skimming the
> patches without reading the whole series carefully).
> 
> Maybe try a test which has an entry, which requires the 'prefetch'
> modification, that immediately follows a 'tag' or 'empty dst' entry.
> (I can't quite tell, just reading the email, whether that is covered
> by the tests below - so please just ignore me if it already works ;)

You are absolutely right! Thanks.

-Stolee



[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