summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2fe167b)
raw | patch | inline | side by side (parent: 2fe167b)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 2 Oct 2007 16:24:44 +0000 (12:24 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 3 Oct 2007 04:14:18 +0000 (00:14 -0400) |
gitk expects $env(GIT_DIR) to be valid as both a path that core Git
and Tcl/Tk can resolve to a valid directory, but it has no special
handling for Cygwin style UNIX paths and Windows style paths. So
we need to do that for gitk and ensure that only relative paths are
fed to it, thus allowing both Cygwin style and UNIX style paths to
be resolved.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
and Tcl/Tk can resolve to a valid directory, but it has no special
handling for Cygwin style UNIX paths and Windows style paths. So
we need to do that for gitk and ensure that only relative paths are
fed to it, thus allowing both Cygwin style and UNIX style paths to
be resolved.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index c8375029dd35964bb299b87612b4978cdcfda85b..9682418e1225499caf99151e8a91968cdb106c2c 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
if {! [file exists $exe]} {
error_popup "Unable to start gitk:\n\n$exe does not exist"
} 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