git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ls-files: don't try to prune an empty index

From
René Scharfe <l.s.r@web.de>
Date
Jul 16, 2017, 11:32 UTC
Message-ID
<c408be84-c35f-bf3a-4699-9dd0b5de93ef@web.de>
In-Reply-To
<31e6bebd-f2f5-b85d-2865-49611aecb2b8@web.de>
Am 16.07.2017 um 13:15 schrieb René Scharfe:
Show 29 quoted lines
> Am 16.07.2017 um 13:08 schrieb Jeff King:
>> On Sun, Jul 16, 2017 at 01:06:45PM +0200, René Scharfe wrote:
>>
>>>>> diff --git a/builtin/ls-files.c b/builtin/ls-files.c
>>>>> index b8514a0029..adf572da68 100644
>>>>> --- a/builtin/ls-files.c
>>>>> +++ b/builtin/ls-files.c
>>>>> @@ -362,7 +362,7 @@ static void prune_index(struct index_state 
>>>>> *istate,
>>>>>        int pos;
>>>>>        unsigned int first, last;
>>>>>
>>>>> -    if (!prefix)
>>>>> +    if (!prefix || !istate->cache_nr)
>>>>>            return;
>>>>>        pos = index_name_pos(istate, prefix, prefixlen);
>>>>>        if (pos < 0)
>>>>
>>>> "git am" complained that this does not apply to its blobs. Did you
>>>> hand-edit?
>>>
>>> I didn't, but perhaps I messed up the order of patches?  MOVE_ARRAY
>>> patch 2 touches the same file, but I wouldn't expect the two changes to
>>> conflict.  So not sure what's going on.
>>
>> For some reason there's an extra space before the tab on each of the
>> context lines. MUA issue or cut-and-paste, maybe?
> 
> That's possible.  Will resend.
... pressed Send to fast.  Thanks for reporting the broken patch!

I use the extension Toggle Word Wrap with Thunderbird, but it wraps by default with no way to change that, so I forgot toggling this time. Grr, I've had enough of this! Went past the warranty warning and set mailnews.wraplength=0 now.

René
Previous: René ScharfeNext: René Scharfe
Message 8 of 9 in “ls-files: don't try to prune an empty index”
  1. ls-files: don't try to prune an empty indexRené Scharfe, Jul 15, 2017
  2. Ramsay JonesJul 16, 2017
  3. René ScharfeJul 16, 2017
  4. Jeff KingJul 16, 2017
  5. René ScharfeJul 16, 2017
  6. Jeff KingJul 16, 2017
  7. René ScharfeJul 16, 2017
  8. René ScharfeJul 16, 2017
  9. ls-files: don't try to prune an empty indexRené Scharfe, Jul 16, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.