Skip to content

Commit b01d432

Browse files
marcowsspearce
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 454efb4 commit b01d432

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

windows/git-gui.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
exec wish "$0" -- "$@"
44

55
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+
}
712
set argv [lrange $argv 2 end]
813
incr argc -2
914
}

0 commit comments

Comments
 (0)