mirror of
https://github.com/git/git.git
synced 2026-02-05 15:34:07 +00:00
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 <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -270,12 +270,11 @@ proc is_Windows {} {
|
||||
proc is_Cygwin {} {
|
||||
global _iscygwin
|
||||
if {$_iscygwin eq {}} {
|
||||
if {$::tcl_platform(platform) eq {windows}} {
|
||||
if {[catch {set p [exec cygpath --windir]} err]} {
|
||||
set _iscygwin 0
|
||||
} else {
|
||||
set _iscygwin 1
|
||||
}
|
||||
if {$::tcl_platform(platform) eq {windows} &&
|
||||
![info exists ::env(MSYSTEM)] &&
|
||||
$::env(MSYSTEM) ne {MSYS}} {
|
||||
tk_messageBox -message "We're Cygwin"
|
||||
set _iscygwin 1
|
||||
} else {
|
||||
set _iscygwin 0
|
||||
}
|
||||
|
||||
@@ -11,11 +11,17 @@ proc do_windows_shortcut {} {
|
||||
if {[file extension $fn] ne {.lnk}} {
|
||||
set fn ${fn}.lnk
|
||||
}
|
||||
# Use /cmd/git-gui.exe if available
|
||||
set normalized [file normalize $::argv0]
|
||||
regsub "/mingw../libexec/git-core/git-gui$" \
|
||||
$normalized "/cmd/git-gui.exe" cmdLine
|
||||
if {$cmdLine != $normalized && [file exists $cmdLine]} {
|
||||
set cmdLine [list [file nativename $cmdLine]]
|
||||
} else {
|
||||
set cmdLine [list [info nameofexecutable] $normalized]
|
||||
}
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user