diff options
author | Pat Thoyts <patthoyts@users.sourceforge.net> | 2016-10-02 22:19:47 +0100 |
---|---|---|
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | 2016-10-03 11:03:47 +0100 |
commit | f110c46902859832f798fc6777ac6bd0e661804a (patch) | |
tree | 2aedde504ccbe07bbad8c1c5cee9df6b853fd55c /lib | |
parent | git-gui: fix detection of Cygwin (diff) | |
download | tgif-f110c46902859832f798fc6777ac6bd0e661804a.tar.xz |
git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`
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 https://github.com/git-for-windows/git/issues/448
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/shortcut.tcl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/shortcut.tcl b/lib/shortcut.tcl index 78878ef89d..39d23f96df 100644 --- a/lib/shortcut.tcl +++ b/lib/shortcut.tcl @@ -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"] |