Merge branch 'pt/git4win-mods' into pu
authorPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 3 Oct 2016 22:30:32 +0000 (23:30 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 3 Oct 2016 22:30:32 +0000 (23:30 +0100)
git-gui.sh
lib/shortcut.tcl
index 1ed51857e9122707467c8ebe09f30c8aa82fed6e..b097c8c9271115f5408c98411e588477985c5edb 100755 (executable)
@@ -275,6 +275,10 @@ proc is_Cygwin {} {
                                set _iscygwin 0
                        } else {
                                set _iscygwin 1
+                               # Handle MSys2 which is only cygwin when MSYSTEM is MSYS.
+                               if {[info exists ::env(MSYSTEM)] && $::env(MSYSTEM) ne "MSYS"} {
+                                       set _iscygwin 0
+                               }
                        }
                } else {
                        set _iscygwin 0
index 78878ef89d11210d614fc8b3d2957705611bdaa3..39d23f96dfcab14e5f921450522d332e39e70abe 100644 (file)
@@ -11,11 +11,14 @@ proc do_windows_shortcut {} {
                if {[file extension $fn] ne {.lnk}} {
                        set fn ${fn}.lnk
                }
+               # Use git-gui.exe if available (ie: git-for-windows)
+               set cmdLine [auto_execok git-gui.exe]
+               if {$cmdLine eq {}} {
+                       set cmdLine [list [info nameofexecutable] \
+                                                        [file normalize $::argv0]]
+               }
                if {[catch {
-                               win32_create_lnk $fn [list \
-                                       [info nameofexecutable] \
-                                       [file normalize $::argv0] \
-                                       ] \
+                               win32_create_lnk $fn $cmdLine \
                                        [file normalize $_gitworktree]
                        } err]} {
                        error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]