Skip to content

Commit

Permalink
git-gui (Windows): use git-gui.exe in Create Desktop Shortcut
Browse files Browse the repository at this point in the history
When calling `Repository>Create Desktop Shortcut`, Git GUI assumes
that it is okay to call `wish.exe` directly on Windows. However, in
Git for Windows 2.x' context, that leaves several crucial environment
variables uninitialized, resulting in a shortcut that does not work.

To fix those environment variable woes, Git for Windows comes with a
convenient `git-gui.exe`, so let's just use it when it is available.

This fixes #448

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
patthoyts authored and Git for Windows Build Agent committed Oct 20, 2016
1 parent 02e9e61 commit 8129ff4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions git-gui/lib/shortcut.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 8129ff4

Please sign in to comment.