+ public function checkGit()
+ {
+ $line = exec('git --version', $lines, $retval);
+ if ($retval !== 0) {
+ $this->fail('Running git executable failed.');
+ }
+ if (!preg_match('#^git version ([0-9.]+)$#', $line, $matches)) {
+ $this->fail('git version output format unexpected: ' . $line);
+ }
+ if (version_compare($matches[1], '1.7.5') < 0) {
+ $this->fail(
+ 'git version needs to be at least 1.7.5, got: ' . $matches[1]
+ );
+ }
+ }
+