Subject: Re: [PATCH v1 02/11] git-gui: refactor browser / blame argument parsing

From: Mark Levedahl <[email-masked]>
Date: Sat, 16 May 2026 10:21:28 -0400

On 5/15/26 11:56 AM, Johannes Sixt wrote:
snip...
> 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