From 38c2373b5bc4bc66cc424c5e0d6cce5d4ad94df0 Mon Sep 17 00:00:00 2001
From: "yuuji.yaginuma" <yuuji.yaginuma@gmail.com>
Date: Sat, 18 Feb 2017 10:59:46 +0900
Subject: Do not run `git init` in dummy application

---
 railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 2 +-
 railties/test/generators/plugin_generator_test.rb              | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'railties')

diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
index 49259f32c8..be211e016d 100644
--- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
+++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
@@ -91,6 +91,7 @@ task default: :test
       opts[:skip_bundle] = true
       opts[:api] = options.api?
       opts[:skip_listen] = true
+      opts[:skip_git] = true
 
       invoke Rails::Generators::AppGenerator,
         [ File.expand_path(dummy_path, destination_root) ], opts
@@ -112,7 +113,6 @@ task default: :test
 
     def test_dummy_clean
       inside dummy_path do
-        remove_file ".gitignore"
         remove_file "db/seeds.rb"
         remove_file "doc"
         remove_file "Gemfile"
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index ddfbc1a698..eaf1199601 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -491,6 +491,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
     assert_no_directory "test/dummy/doc"
     assert_no_directory "test/dummy/test"
     assert_no_directory "test/dummy/vendor"
+    assert_no_directory "test/dummy/.git"
   end
 
   def test_skipping_test_files
-- 
cgit v1.2.3