From 8a19900e7b820534bb8957a9d95680ac4af7f7dd Mon Sep 17 00:00:00 2001 From: idl0r Date: Fri, 1 May 2009 19:03:07 +0000 Subject: [PATCH] Respect $PATH while looking for git, thanks to grobian. svn path=/; revision=570 --- trunk/src/echangelog/echangelog | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/trunk/src/echangelog/echangelog b/trunk/src/echangelog/echangelog index c267c28..f4a0813 100755 --- a/trunk/src/echangelog/echangelog +++ b/trunk/src/echangelog/echangelog @@ -104,10 +104,16 @@ if ( -d "CVS" ) { } elsif ( -d '.svn' ) { $vcs = "svn"; } else { - if ( -x '/usr/bin/git' ) { - open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null"); - $vcs = "git" if defined(); - close(GIT); + # Respect $PATH while looking for git + if (getenv("PATH")) { + foreach my $path ( split(":", getenv("PATH")) ) { + if ( -X "$path/git" ) { + open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null"); + $vcs = "git" if defined(); + close(GIT); + last; + } + } } if ( ! $vcs ) { -- 2.26.2