]> Kevux Git Server - rit/commitdiff
git-gui: allow specifying path '.' to the browser
authorMark Levedahl <mlevedahl@gmail.com>
Sun, 31 May 2026 23:02:23 +0000 (19:02 -0400)
committerJohannes Sixt <j6t@kdbg.org>
Tue, 2 Jun 2026 17:13:13 +0000 (19:13 +0200)
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 <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
git-gui.sh

index 57d48cc..40a8348 100755 (executable)
@@ -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!