I am planning to change how we clone GitHub pull requests in a future version of drone. The below script demonstrates what this new logic will look like:
#!/bin/sh set -e set -x git clone -b master --single-branch https://github.com/octocat/Spoon-Knife.git \ /drone/src/github.com/octocat/Spoon-Knife cd Spoon-Knife git fetch origin pull/14596/head: git rebase 26923a8f37933ccc23943de0d4ebd53908268582
- Improved error when merge conflicts exist
- Uses the correct sha for pull request synchronizations
- Does not rely on the merge ref
- Rebase preserves the head sha, which is important for coveralls, codecov, etc
There are of course many ways to clone a project and checkout a commit. This will be the default, but you will always have the ability to override this default behavior with a plugin.