This issue #627012: Improve description for --working-copy introduced cleaning up of .git files (and other protocols) after fetching the component.

In the case of git, it removes it after clone, and then again after checking out a branch.. unfortunately you cannot checkout the branch if you've already removed the .git db files or else you'll get a 'Fatal: not a git repository' error:

Executing: git clone 'git://git.mig5.net/drupal/profiles/feature_server' '/tmp/drush_make_tmp_1261011208'/'feature_server' ..
Initialized empty Git repository in /tmp/drush_make_tmp_1261011208/feature_server/.git/..
Executing: rm -rf '/tmp/drush_make_tmp_1261011208'/'feature_server'/.git ...
feature_server cloned from git://git.mig5.net/drupal/profiles/feature_server. ...
Executing: git checkout -b 'community_featureservers_org' origin/'community_featureservers_org'
  fatal: Not a git repository
Unable to check out branch community_featureservers_org.

We should only remove the .git files after everything has finished (i.e only after the clone *and* a potential branch has been checked out).

Patch attached. Not sure if other protocols are affected in the same way (looked at Hg, didn't see any branch action)

CommentFileSizeAuthor
drush_make_delete_git_after_branch.patch1.58 KBmig5
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Status: Active » Needs review

oops.

dmitrig01’s picture

Status: Needs review » Fixed

Good catch

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.