summaryrefslogtreecommitdiff
path: root/git-gui/windows/git-gui.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-gui/windows/git-gui.sh')
-rwxr-xr-x[-rw-r--r--]git-gui/windows/git-gui.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/git-gui/windows/git-gui.sh b/git-gui/windows/git-gui.sh
index 53c3a94686..b1845c5055 100644..100755
--- a/git-gui/windows/git-gui.sh
+++ b/git-gui/windows/git-gui.sh
@@ -3,15 +3,21 @@
exec wish "$0" -- "$@"
if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
- cd [lindex $argv 1]
+ set workdir [lindex $argv 1]
+ cd $workdir
+ if {[lindex [file split $workdir] end] eq {.git}} {
+ # Workaround for Explorer right click "Git GUI Here" on .git/
+ cd ..
+ }
set argv [lrange $argv 2 end]
incr argc -2
}
-set bindir [file dirname \
+set basedir [file dirname \
[file dirname \
[file dirname [info script]]]]
-set bindir [file join $bindir bin]
+set bindir [file join $basedir bin]
+set bindir "$bindir;[file join $basedir mingw bin]"
regsub -all ";" $bindir "\\;" bindir
set env(PATH) "$bindir;$env(PATH)"
unset bindir