git-gui (Win): make starting via "Git GUI Here" on .git/ possible
This works around git-gui's error message Cannot use funny .git directory: . when started from the .git/ directory, which is useful in repositories without any directories for the right click. Now git-gui can be started via Windows Explorer shell extension (Git GUI Here) from the .git/ directory. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Markus Heidelberg committed
Apr 1, 2009 at 01:55 UTC
b01d4326040ec6b9d98baba32091c9458fc809d4
1 file changed
+6
-1
windows/git-gui.sh
+6
-1
@@ -3,7 +3,12 @@
3
exec wish "$0" -- "$@"
4
5
if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
6
- cd [lindex $argv 1]
6
+ set workdir [lindex $argv 1]
7
+ cd $workdir
8
+ if {[lindex [file split $workdir] end] eq {.git}} {
9
+ # Workaround for Explorer right click "Git GUI Here" on .git/
10
+ cd ..
11
+ }
12
set argv [lrange $argv 2 end]
13
incr argc -2
14
}