@matheusbsbs / matheus-bagliano / commits / 906ab7f6c0
Fork 0

git-gui: Don't crash when starting gitk from a browser session

If the user has started git-gui from the command line as a browser we offer the gitk menu options but we didn't create the main status bar widget in the "." toplevel. Trying to access it while starting gitk just results in Tcl errors. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Oct 2, 2007 at 12:27 UTC 906ab7f6c03764423adef6c0e4d77442405adc23
1 file changed +8 -2
git-gui.sh
+8 -2
@@ -1125,11 +1125,17 @@ proc mapdesc {state path} {
1125 }
1126
1127 proc ui_status {msg} {
1128 - $::main_status show $msg
1128 + global main_status
1129 + if {[info exists main_status]} {
1130 + $main_status show $msg
1131 + }
1132 }
1133
1134 proc ui_ready {{test {}}} {
1132 - $::main_status show {Ready.} $test
1135 + global main_status
1136 + if {[info exists main_status]} {
1137 + $main_status show [mc "Ready."] $test
1138 + }
1139 }
1140
1141 proc escape_path {path} {