From 17a5f0df6886a4627ef773d1aa3c027e3237d71f Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 26 Feb 2025 18:09:50 -0500 Subject: [PATCH] =?UTF-8?q?Test=20that=20`.git`=20directory=20is=20preserv?= =?UTF-8?q?ed=20when=20exporting=20with=20`=E2=80=94clear`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/StarterKits/ExportTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/StarterKits/ExportTest.php b/tests/StarterKits/ExportTest.php index 7a536a84ee..6f51a373fa 100644 --- a/tests/StarterKits/ExportTest.php +++ b/tests/StarterKits/ExportTest.php @@ -173,7 +173,11 @@ public function it_can_clear_target_export_path_with_clear_option() base_path('two'), ]); - // Imagine this exists from previous export + // Imagine we already have a target a git repo + $this->files->makeDirectory($this->targetPath('.git'), 0777, true, true); + $this->files->put($this->targetPath('.git/config'), 'Config.'); + + // And imagine this exists from previous export $this->files->makeDirectory($this->exportPath('one'), 0777, true, true); $this->files->put($this->exportPath('one/file.md'), 'One.'); @@ -195,10 +199,13 @@ public function it_can_clear_target_export_path_with_clear_option() $this->exportCoolRunnings(['--clear' => true]); - // But 'one' folder should exist after exporting with `--clear` option + // Our 'one' folder shouldn't exist after exporting with `--clear` option $this->assertFileDoesNotExist($this->exportPath('one')); $this->assertFileExists($this->exportPath('two')); + // But it should not clear `.git` directory + $this->assertFileExists($this->targetPath('.git/config')); + $this->exportCoolRunnings(); $this->cleanPaths($paths);