浏览代码

Only ask for gitignore if the current dir is a git repo, fixes composer/satis#44

Jordi Boggiano 12 年之前
父节点
当前提交
e7f4768668
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Command/InitCommand.php

+ 1 - 1
src/Composer/Command/InitCommand.php

@@ -120,7 +120,7 @@ EOT
 
         $file->write($options);
 
-        if ($input->isInteractive()) {
+        if ($input->isInteractive() && is_dir('.git')) {
             $ignoreFile = realpath('.gitignore');
 
             if (false === $ignoreFile) {