浏览代码

Simplify check

Jordi Boggiano 13 年之前
父节点
当前提交
fa8cb14073
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/Repository/Vcs/GitDriver.php

+ 2 - 2
src/Composer/Repository/Vcs/GitDriver.php

@@ -172,8 +172,8 @@ class GitDriver extends VcsDriver implements VcsDriverInterface
         // local filesystem
         // local filesystem
         if (preg_match('{^(file://|/|[a-z]:[\\\\/])}', $url)) {
         if (preg_match('{^(file://|/|[a-z]:[\\\\/])}', $url)) {
             $process = new ProcessExecutor();
             $process = new ProcessExecutor();
-            $process->execute(sprintf('cd %s && git log -1 --format=%%at', escapeshellarg($url)), $output);
-            if (is_numeric(trim($output))) {
+            // check whether there is a git repo in that path
+            if ($process->execute(sprintf('cd %s && git show', escapeshellarg($url)), $output) === 0) {
                 return true;
                 return true;
             }
             }
         }
         }