Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: a5ce2721d8
...
compare: 83b6a18aa7
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 27, 2012
@gnustavo Check if we have at least git 1.5 to work with.
Gits older than this do not support "git init", which we need for testing.
9183b7c
@gnustavo v0.013
	Require at least git 1.5 to work with.
83b6a18
Showing with 21 additions and 3 deletions.
  1. +6 −0 Changes
  2. +15 −3 Makefile.PL
View
6 Changes
@@ -2,8 +2,14 @@ Revision history for Git-Hooks. -*- text -*-
{{$NEXT}}
+0.013 2012-07-27 17:11:17 America/Sao_Paulo
+
+ Require at least git 1.5 to work with.
+
0.012 2012-07-26 12:11:10 America/Sao_Paulo
+ Improve testing framework.
+
0.011 2012-07-25 11:12:01 America/Sao_Paulo
Improve testing framework.
View
18 Makefile.PL
@@ -3,9 +3,21 @@ use warnings;
##{ $perl_prereq ? qq[use $perl_prereq;] : ''; ##}
-# Check if we have Git installed
-unless (system(qw/git version/) == 0) {
- warn "Can't find git in PATH.\n";
+# Check if we have a proper git
+chomp(my $git_version = `git version`);
+if ($? == -1) {
+ warn "Failed to execute 'git version': $!\n";
+ exit 0;
+} elsif ($? != 0) {
+ warn "Command 'git version' died with exit code=$?\n";
+ exit 0;
+} elsif (my ($major, $minor) = ($git_version =~ /(\d+)\.(\d+)/)) {
+ if ($major < 1 || $major == 1 && $minor < 5) {
+ warn "Don't support gits older than 1.5. Your version is $git_version.\n";
+ exit 0;
+ }
+} else {
+ warn "Couldn't parse git version: '$git_version'\n";
exit 0;
}

No commit comments for this range

Something went wrong with that request. Please try again.