Fixed git detection.
authoridl0r <idl0r@gentoo.org>
Thu, 30 Apr 2009 15:06:15 +0000 (15:06 -0000)
committeridl0r <idl0r@gentoo.org>
Thu, 30 Apr 2009 15:06:15 +0000 (15:06 -0000)
svn path=/; revision=556

trunk/src/echangelog/echangelog

index 4b1f786c50367a5f89e2e38ebceaee9ba51807a5..fea1af67c67eb948f86ca4236ee443b8444dee8b 100755 (executable)
@@ -90,11 +90,16 @@ if ( -d "CVS" ) {
        $vcs = "cvs";
 } elsif ( -d '.svn' ) {
        $vcs = "svn";
-} elsif ( -f '/usr/bin/git' and open GIT, "git rev-parse --git-dir |" ) {
-       $vcs = "git";
-       close GIT;
 } else {
-       die "No CVS, .git, .svn directories found, what kind of repo is this?";
+       if ( -x '/usr/bin/git' ) {
+               open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null");
+               $vcs = "git" if defined(<GIT>);
+               close(GIT);
+       }
+
+       if ( ! $vcs ) {
+               die "No CVS, .git, .svn directories found, what kind of repo is this?";
+       }
 }
 
 # Read the current ChangeLog