From: Mark Levedahl Date: Sat, 16 May 2026 14:21:28 GMT Subject: Re: [PATCH v1 02/11] git-gui: refactor browser / blame argument parsing Message-ID: <465bcbef-bec9-4f7c-b55f-ed60f23cbcb2@gmail.com> In-Reply-To: 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