Re: BUG?: git-apply sometimes says "corrupt patch" when adding single lines

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

 



On Wed, Aug 18, 2010 at 1:43 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Tor Arvid Lund wrote:
>
>> I don't really know the git-gui code or the git C code well, but it
>> seems that I got around the error with this small patch:
>>
>> diff --git a/builtin/apply.c b/builtin/apply.c
>> index 12ef9ea..124791f 100644
>> --- a/builtin/apply.c
>> +++ b/builtin/apply.c
>> @@ -1335,6 +1335,8 @@ static int parse_fragment(char *line, unsigned long size,
>>                * l10n of "\ No newline..." is at least that long.
>>                */
>>               case '\\':
>> +                     if (newlines == oldlines == 1)
> [...]
>
> Heh.  This code is a roundabout way to say "if (newlines == oldlines)",
> rather than "if (newlines == 1 && oldlines == 1)" that might have been
> intended.

Right you are, good sir ;-)

> Unfortunately I do not have any more insight than that.  If you can
> give an example reproducing this with git apply from the command
> line, that would be very helpful.

I'll try to do that tomorrow.. My brain needs sleep before it will function :)

-Tor Arvid-
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]