commit 58c8f4d785f20670c29525396c1bdc23a7ca3416
Author: Raphaël Droz <raphael.droz+floss@gmail.com>
Date:   Wed Oct 26 14:59:06 2011 +0200

    Conditionnally clean-up .git directory (fix for #627012)

diff --git a/drush_make.download.inc b/drush_make.download.inc
index 4187e89..44399ee 100644
--- a/drush_make.download.inc
+++ b/drush_make.download.inc
@@ -1,9 +1,15 @@
 <?php
 
-function drush_make_download_factory($name, $download, $download_location) {
+function drush_make_download_factory($config) {
+  $name = $config->name;
+  $download = $config->download;
+  $download_location = $config->project_directory;
   $function = 'drush_make_download_' . $download['type'];
   if (function_exists($function)) {
-    return $function($name, $download, $download_location);
+    if($download['type'] == 'git')
+      return $function($name, $download, $download_location, $config->options);
+    else
+      return $function($name, $download, $download_location);
   }
   else {
     return FALSE;
@@ -342,7 +348,7 @@ function drush_make_download_post($name, $download, $download_location) {
   return drush_make_download_file($name, $download, $download_location);
 }
 
-function drush_make_download_git($name, $download, $download_location) {
+function drush_make_download_git($name, $download, $download_location, $options) {
   $tmp_path = drush_make_tmp();
   $wc = drush_get_option('working-copy');
 
@@ -485,7 +491,7 @@ function drush_make_download_git($name, $download, $download_location) {
     }
 
     // Remove .git/ directory if working-copy flag was not specified.
-    if (!$wc && file_exists($tmp_location . '/.git')) {
+    if (!$wc && file_exists($tmp_location . '/.git') && ! (isset($options) && $options['stripvcsdir'] === false) ) {
       drush_shell_exec("rm -rf %s", $tmp_location . '/.git');
     }
     drush_shell_exec('cp -Rf %s %s', $tmp_location, dirname($download_location));
diff --git a/drush_make.drush.inc b/drush_make.drush.inc
index 9b1b7a9..508e324 100644
--- a/drush_make.drush.inc
+++ b/drush_make.drush.inc
@@ -177,6 +177,7 @@ function drush_make_projects($recursion, $contrib_destination, $info) {
       'location'            => drush_get_option('drush-make-update-default-url'),
       'subdir'              => '',
       'directory_name'      => (isset($project['type']) && $project['type'] == 'library' ? $key : ''),
+      'options'             => isset($info['options']) ? $info['options'] : '',
     ));
 
     if ($project['location'] != 'http://updates.drupal.org/release-history' && !isset($project['type'])) {
diff --git a/drush_make.project.inc b/drush_make.project.inc
index 10c1323..da52d0e 100644
--- a/drush_make.project.inc
+++ b/drush_make.project.inc
@@ -23,7 +23,7 @@ class DrushMakeProject {
       return FALSE;
     }
     $this->project_directory = $this->findDownloadLocation();
-    if (drush_make_download_factory($this->name, $this->download, $this->project_directory) === FALSE) {
+    if (drush_make_download_factory($this) === FALSE) {
       return FALSE;
     }
     if (!$this->addLockfile()) {
diff --git a/drush_make.utilities.inc b/drush_make.utilities.inc
index 9e9f079..dc0d267 100644
--- a/drush_make.utilities.inc
+++ b/drush_make.utilities.inc
@@ -90,6 +90,15 @@ function drush_make_validate_info_file($info) {
 
   $names = array();
 
+  if (isset($info['options']['stripvcsdir'])) {
+    if(in_array(strtolower($info['options']['stripvcsdir']), array('true', '1', 'yes', 'y')))
+      $info['options']['stripvcsdir'] = true;
+    else
+      $info['options']['stripvcsdir'] = false;
+  }
+  else
+    $info['options']['stripvcsdir'] = true;
+
   // Process projects.
   if (isset($info['projects'])) {
     if (!is_array($info['projects'])) {
