gitlabhq/gitlabhq — pull request #4668 by davvid (2013-07-29 22:51:51+00:00)
Title: satellites: fix checkout sequence when merging requests

"git checkout -b" will fail when the target branch already exists in the
satellite repository, which makes gitlab unable to process merge
requests.

Change the checkout sequence to be more robust. Use "git checkout "
so that an existing branch can be used if it already exists.

Use "git reset --hard" and "git clean" to ensure that the state is known
before attempting the merge.

Closes #3697