I've looked around for a report of this bug and didn't see anything, but I've no idea how popular this feature of drush make is. I have a project specified with a branch to be checked out in my .make file, like so:
projects[myproject][type] = "module"
projects[myproject][download][type] = "git"
projects[myproject][download][url] = "git@projects.example.com:myproject.git"
projects[myproject][download][branch] = "somebranch"
When I run the make file, drush happily clones the repository, and then attempts to checkout the 'somebranch' branch, hitting the first if condition in the "branch" section of make_download_git(). When I run this series of commands manually, the same thing happens- git silently fails to check out the branch, apparently because the origin/ branch it's tracking hasn't been mentioned yet. To fix this, I need the second version of the command to run: git checkout -b origin/
I'm not sure if this is particular to my version of git, but it's unclear to me what's the best fix- I'm not sure if there is ever a case where this first condition on line 310 works properly, or if the second form fails on some (older?) versions of git, perhaps. In any case, I've got a simple patch forthcoming which strengthens the check on the first if condition, checking for empty output (it seems that when the command works, it says so).
Comment | File | Size | Author |
---|---|---|---|
#1 | branch-checkout-fails-1989280.patch | 773 bytes | spiderman |
Comments
Comment #1
spidermanI should have mentioned: I'm running Drush 5.9, but a quick peek at the make.download.inc on the 8.x-6.x branch indicates this logic is unchanged, so this one-liner should apply wherever.
Comment #2
lslinnet CreditAttribution: lslinnet commentedI ran into the same issue, tested your patch and seems to fixed the issue.
build in the above code basically executes
but maintains settings files.
Comment #3
jhedstromThanks! Committed #1 to both 5.x and 6.x.