From e7f4768668ecec238f45ef881c4db8b5e77bbb74 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 8 Dec 2012 17:47:44 +0100 Subject: [PATCH] Only ask for gitignore if the current dir is a git repo, fixes composer/satis#44 --- src/Composer/Command/InitCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 61bb598da..652eba1d8 100644 --- a/src/Composer/Command/InitCommand.php +++ b/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) {