diff --git a/commands/make/make.download.inc b/commands/make/make.download.inc index dbf3c3d..03210c9 100644 --- a/commands/make/make.download.inc +++ b/commands/make/make.download.inc @@ -334,14 +334,14 @@ function make_download_git($name, $download, $download_location) { // Move back to last current directory (first line). chdir($cwd); - // Remove .git/ directory if working-copy flag was not specified. - if (!$wc && file_exists($tmp_location . '/.git')) { - drush_delete_dir($tmp_location . '/.git', TRUE); - } - // Move the directory into the final resting location. drush_copy_dir($tmp_location, $download_location, TRUE); + // Remove .git/ directory if working-copy flag was not specified. + if (!$wc && file_exists($download_location . '/.git')) { + drush_register_file_for_deletion($download_location . '/.git'); + } + return dirname($tmp_location); } diff --git a/tests/makeTest.php b/tests/makeTest.php index af4d0bc..b28c89f 100644 --- a/tests/makeTest.php +++ b/tests/makeTest.php @@ -310,6 +310,13 @@ class makeMakefileCase extends Drush_CommandTestCase { // Verify git reference cache exists. $this->assertFileExists($cache_dir . '/git/context_admin-' . md5('http://git.drupal.org/project/context_admin.git')); + + // Text caption_filter .info rewrite. + $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info'); + $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info'); + $this->assertContains('; Information added by drush on ' . date('Y-m-d'), $contents); + $this->assertContains('version = "7.x-1.2+0-dev"', $contents); + $this->assertContains('project = "caption_filter"', $contents); } function testMakeFileExtract() { diff --git a/tests/makefiles/git-simple.make b/tests/makefiles/git-simple.make index d21494a..9bec8fc 100644 --- a/tests/makefiles/git-simple.make +++ b/tests/makefiles/git-simple.make @@ -7,3 +7,9 @@ projects[cck_signup][download][revision] = "2fe932c" ; Test that revision passed in main level works as shorthand for download revision. projects[context_admin][revision] = "eb9f05e" + +; When branch is passed in addition to revision, .info file rewriting has better versioning. +projects[caption_filter][subdir] = "contrib" +projects[caption_filter][download][type] = "git" +projects[caption_filter][download][branch] = "7.x-1.x" +projects[caption_filter][download][revision] = "c9794cf"