From 7c7c7ba4cea2f0063efa2a2a0d7c3d05ed8766fb Mon Sep 17 00:00:00 2001 From: Mark Levedahl Date: Sun, 31 May 2026 19:02:23 -0400 Subject: [PATCH] git-gui: allow specifying path '.' to the browser Invoking "git-gui browser rev ." should show the file browser for the commitish rev, starting at the current directory. When the current directory is the working tree root, this errors out in normalize_relpath because the '.' is removed, yielding an empty list as argument to [file join ...]. git ls-tree (underlying the browser) accepts '.', so use that as the value when in the root. Signed-off-by: Mark Levedahl Signed-off-by: Johannes Sixt --- git-gui.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git-gui.sh b/git-gui.sh index 57d48cc838..40a83487d6 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2992,7 +2992,11 @@ proc normalize_relpath {path} { } lappend elements $item } - return [eval file join $elements] + if {$elements ne {}} { + return [eval file join $elements] + } else { + return {.} + } } # -- Not a normal commit type invocation? Do that instead!