summaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src')
-rwxr-xr-xtrunk/src/echangelog/echangelog14
1 files 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(<GIT>);
- 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(<GIT>);
+ close(GIT);
+ last;
+ }
+ }
}
if ( ! $vcs ) {