[GIT GUI PATCH 1/2] git-gui: teach _which procedure to work with absolute paths
- From
Heiko Voigt <hvoigt@hvoigt.net>
- Date
- Mar 23, 2012, 17:30 UTC
- Message-ID
- <e7a733b5ad4e2009aec205235a95a610ee18947b.1332523097.git.hvoigt@hvoigt.net>
- In-Reply-To
- <cover.1332523097.git.hvoigt@hvoigt.net>
_which is useful to check whether a certain command can be called. Previously when given an absolute path it would not recognize it as an existing program. Lets change that so it transparently handles such cases.
Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de> --- git-gui/git-gui.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index ba4e5c1..35cdee8 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -429,6 +429,10 @@ proc _git_cmd {name} { proc _which {what args} { global env _search_exe _search_path + if {[file exists $what]} { + return [file normalize $what] + } + if {$_search_path eq {}} { if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} { set _search_path [split [exec cygpath \
-- 1.7.10.rc1.29.gf035d