git-gui: Parse off refs/remotes when showing current branch.
authorShawn O. Pearce <spearce@spearce.org>
Sat, 25 Nov 2006 07:45:19 +0000 (02:45 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 25 Nov 2006 07:45:19 +0000 (02:45 -0500)
Even though the user shouldn't have a remote branch checked out, if
they do we should still show as short of the branch name as possible.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui

diff --git a/git-gui b/git-gui
index 69ebd90958acaa488e3c06a560e4454ecd8d8c27..48e781dd3011451264b4d4c0ea11ee127c36476e 100755 (executable)
--- a/git-gui
+++ b/git-gui
@@ -266,7 +266,7 @@ proc repository_state {ctvar hdvar mhvar} {
        if {[catch {set current_branch [exec git symbolic-ref HEAD]}]} {
                set current_branch {}
        } else {
-               regsub ^refs/(heads|tags)/ \
+               regsub ^refs/((heads|tags|remotes)/)? \
                        $current_branch \
                        {} \
                        current_branch