summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorSteffen Prohaska <prohaska@zib.de>2007-10-06 09:29:02 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-10 06:26:00 (GMT)
commitbe700fe30fd17b3f9b600de9110c74035091a007 (patch)
tree6b9c630376eda0ec5ccfdb4537a69a1f7d6ccfa0 /git-gui.sh
parent3ea16e569abce653e02632995aa32287d2f54360 (diff)
downloadgit-be700fe30fd17b3f9b600de9110c74035091a007.zip
git-be700fe30fd17b3f9b600de9110c74035091a007.tar.gz
git-be700fe30fd17b3f9b600de9110c74035091a007.tar.bz2
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>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index e17efb7..6b7bdbc 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -343,6 +343,9 @@ proc _which {what} {
$env(PATH)] {;}]
set _search_exe .exe
} elseif {[is_Windows]} {
+ set gitguidir [file dirname [info script]]
+ regsub -all ";" $gitguidir "\\;" gitguidir
+ set env(PATH) "$gitguidir;$env(PATH)"
set _search_path [split $env(PATH) {;}]
set _search_exe .exe
} else {