Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Wed, 3 Oct 2007 04:17:19 +0000 (00:17 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 3 Oct 2007 04:17:19 +0000 (00:17 -0400)
* maint:
git-gui: Don't crash when starting gitk from a browser session
git-gui: Allow gitk to be started on Cygwin with native Tcl/Tk

Conflicts:

git-gui.sh

1  2 
git-gui.sh
diff --cc git-gui.sh
index 82f873bdcde560243646eae22561cbf027259525,cf88a0d8247e8578e5740d290ee1e72b011f2fe2..3f5927fb2921d6e493fd1fd3d4541a7ab736f768
@@@ -1575,9 -1472,29 +1581,29 @@@ proc do_gitk {revs} 
        set exe [file join [file dirname $::_git] gitk]
        set cmd [list [info nameofexecutable] $exe]
        if {! [file exists $exe]} {
 -              error_popup "Unable to start gitk:\n\n$exe does not exist"
 +              error_popup [mc "Unable to start gitk:\n\n%s does not exist" $exe]
        } else {
+               global env
+               if {[info exists env(GIT_DIR)]} {
+                       set old_GIT_DIR $env(GIT_DIR)
+               } else {
+                       set old_GIT_DIR {}
+               }
+               set pwd [pwd]
+               cd [file dirname [gitdir]]
+               set env(GIT_DIR) [file tail [gitdir]]
                eval exec $cmd $revs &
+               if {$old_GIT_DIR eq {}} {
+                       unset env(GIT_DIR)
+               } else {
+                       set env(GIT_DIR) $old_GIT_DIR
+               }
+               cd $pwd
                ui_status $::starting_gitk_msg
                after 10000 {
                        ui_ready $starting_gitk_msg