Skip to content

Commit 6f61c96

Browse files
committed
Merge branch 'msys2-git-gui'
This topic branch addresses the bug where Git for Windows 2.x' Git GUI failed to generate a working shortcut via Repository>Create Desktop Shortcut. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 88ac07e + 2175782 commit 6f61c96

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

git-gui/git-gui.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,10 @@ proc is_Windows {} {
270270
proc is_Cygwin {} {
271271
global _iscygwin
272272
if {$_iscygwin eq {}} {
273-
if {$::tcl_platform(platform) eq {windows}} {
274-
if {[catch {set p [exec cygpath --windir]} err]} {
275-
set _iscygwin 0
276-
} else {
277-
set _iscygwin 1
278-
}
273+
if {$::tcl_platform(platform) eq {windows} &&
274+
(![info exists ::env(MSYSTEM)] ||
275+
$::env(MSYSTEM) ne {MSYS})} {
276+
set _iscygwin 1
279277
} else {
280278
set _iscygwin 0
281279
}

git-gui/lib/shortcut.tcl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ proc do_windows_shortcut {} {
1111
if {[file extension $fn] ne {.lnk}} {
1212
set fn ${fn}.lnk
1313
}
14+
# Use /cmd/git-gui.exe if available
15+
set normalized [file normalize $::argv0]
16+
regsub "/mingw../libexec/git-core/git-gui$" \
17+
$normalized "/cmd/git-gui.exe" cmdLine
18+
if {$cmdLine != $normalized && [file exists $cmdLine]} {
19+
set cmdLine [list [file nativename $cmdLine]]
20+
} else {
21+
set cmdLine [list [info nameofexecutable] $normalized]
22+
}
1423
if {[catch {
15-
win32_create_lnk $fn [list \
16-
[info nameofexecutable] \
17-
[file normalize $::argv0] \
18-
] \
24+
win32_create_lnk $fn $cmdLine \
1925
[file normalize $_gitworktree]
2026
} err]} {
2127
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]

0 commit comments

Comments
 (0)