Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #71 from jd/always-prefix-branch
Browse files Browse the repository at this point in the history
Always prefix remote branch when not forking
  • Loading branch information
mergify[bot] authored Jul 18, 2019
2 parents 870a1a0 + 0916005 commit 75aaac7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions git_pull_request/__init__.py
Original file line number Diff line number Diff line change
@@ -443,9 +443,11 @@ def fork_and_push_pull_request(g, hosttype, repo_to_fork, rebase,
remote_to_push, repo_forked.clone_url])
LOG.info("Added forked repository as remote `%s'", remote_to_push)
head = "{}:{}".format(user, branch)
remote_branch = branch
else:
remote_branch = "{}/{}".format(g_user.login, branch)
remote_to_push = target_remote
head = "{}:{}".format(repo_to_fork.owner.login, branch)
head = "{}:{}".format(repo_to_fork.owner.login, remote_branch)

if setup_only:
LOG.info("Fetch existing branches of remote `%s`", remote_to_push)
@@ -476,10 +478,14 @@ def fork_and_push_pull_request(g, hosttype, repo_to_fork, rebase,
"resolved.")
return 37

LOG.info("Force-pushing branch `%s' to remote `%s'",
branch, remote_to_push)
LOG.info("Force-pushing branch `%s' to remote `%s/%s'",
branch, remote_to_push, remote_branch)

_run_shell_command(["git", "push", "-f", remote_to_push, branch])
_run_shell_command([
"git", "push", "-f",
remote_to_push,
"{}:{}".format(branch, remote_branch),
])

pulls = list(repo_to_fork.get_pulls(base=target_branch,
head=head))

0 comments on commit 75aaac7

Please sign in to comment.