git-gui: add directory git-gui is located in to PATH (on Windows)
This commit modifies PATH to include a good guess where git could be found. The first location to search for executable is the directory git-gui is installed in. This is a good guess for a sane installation. Even if git is not available in PATH, git-gui is now able to find it. Hence git-gui can be passed to wish as an absolute path without caring about the environment. We must modify PATH to be able to spawn shell based git commands. For builtins it would be sufficient to located them and execute them with their absolute path. But for shell based git commmands PATH needs to be modified. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Steffen Prohaska committed
Oct 6, 2007 at 11:29 UTC
be700fe30fd17b3f9b600de9110c74035091a007
1 file changed
+3
git-gui.sh
+3
@@ -343,6 +343,9 @@ proc _which {what} {
343
$env(PATH)] {;}]
344
set _search_exe .exe
345
} elseif {[is_Windows]} {
346
+ set gitguidir [file dirname [info script]]
347
+ regsub -all ";" $gitguidir "\\;" gitguidir
348
+ set env(PATH) "$gitguidir;$env(PATH)"
349
set _search_path [split $env(PATH) {;}]
350
set _search_exe .exe
351
} else {