]> git.ipfire.org Git - thirdparty/git.git/commit
git-gui: simplify [is_bare] to report if a worktree is known
authorMark Levedahl <mlevedahl@gmail.com>
Sun, 31 May 2026 23:02:21 +0000 (19:02 -0400)
committerJohannes Sixt <j6t@kdbg.org>
Tue, 2 Jun 2026 17:13:13 +0000 (19:13 +0200)
commitd0e9b4959bea9f4bfca2628eb24136b23c00e8fa
tree7e79832478d759ecdd194bce894cf0a65b2b01bb
parent80b7207e68ffaf56077d9b7d00eb31490fb48cc5
git-gui: simplify [is_bare] to report if a worktree is known

git-gui includes proc is_bare, used in several places to make decisions
on whether a worktree exists, but also in discovery to tell if a
worktree can be supported.

But, is_bare is out of date with regard to multiple worktrees, safe
repository guards, and possibly other relevant features known to git
rev-parse. Also, is_bare caches its result on the first call, so is not
useful if a later step in the discovery process finds a worktree.

So, simplify is_bare to report whether git-gui has a worktree or is
working only from a repository.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
git-gui.sh