fix git version detection on OSX
authorChristian Weiske <cweiske@cweiske.de>
Tue, 8 Jul 2014 04:55:57 +0000 (06:55 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 8 Jul 2014 04:55:57 +0000 (06:55 +0200)
src/phorkie/SetupCheck.php

index 557d85c..c4d365c 100644 (file)
@@ -101,8 +101,9 @@ class SetupCheck
         if ($retval !== 0) {
             $this->fail('Running git executable failed.');
         }
         if ($retval !== 0) {
             $this->fail('Running git executable failed.');
         }
-        if (!preg_match('#^git version ([0-9.]+(rc[0-9]+)?)$#', $line, $matches)) {
+        if (!preg_match('#^git version ([0-9.]+(rc[0-9]+)?)(?: \(Apple Git-\d+\))?$#', $line, $matches)) {
             $this->fail('git version output format unexpected: ' . $line);
             $this->fail('git version output format unexpected: ' . $line);
+            return;
         }
         if (version_compare($matches[1], '1.7.5') < 0) {
             $this->fail(
         }
         if (version_compare($matches[1], '1.7.5') < 0) {
             $this->fail(