Re: [PATCH v1 02/11] git-gui: refactor browser / blame argument parsing
- From
Mark Levedahl <mlevedahl@gmail.com>
- Date
- May 16, 2026, 14:21 UTC
- Message-ID
- <465bcbef-bec9-4f7c-b55f-ed60f23cbcb2@gmail.com>
- In-Reply-To
- <cb3012ab-1a97-4197-bc57-34eb3fa472a2@kdbg.org>
On 5/15/26 11:56 AM, Johannes Sixt wrote: snip...
Show 9 quoted lines
> The check for the existence of files is actually necessary to
> disambiguate the meaning of the argument. If a file "maint" exists, then
> the argument is to be interpreted as path, not as the ref "maint", even
> if that exists, too.
>
> I suggest to protect the "file exists" calls with ($_gitworktree ne {}
> && ...) or (![is_bare] && ...) to handle being invoked from a bare
> repository. That is, in a bare repository we treat arguments the same as
> files that do not exist in the currently checked-out branch.Let me start over, addressing only the use-case in a bare repository.
Mark