The benefit is that we don't even have to create temp source/target
branches.
Also, when the source branch of the imported MR is from a fork, name it
"user:branch" to mimic how we display it for MR when forks actually
exists.
Signed-off-by: Rémy Coutable <remy@rymai.me>
We don't need to check if the existing branch contains a specific SHA
since we only use the branch's name, the SHA is taken from the pull
request raw `sha` data.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Also, improved a bit the method names in
Github::Representation::PullRequest.
Last but not least, ensure temp branch names doesn't contain a `/` as
this would create the ref in a subfolder in `refs/heads` (e.g.
`refs/heads/gh-123/456/rymai/foo`), and would leave empty directories
upon branch deletion (e.g. `refs/heads/gh-123/456/rymai/`.
Signed-off-by: Rémy Coutable <remy@rymai.me>