1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 14:03:55 +01:00

Merge pull request #11435 from miri64/dist/fix/backport-tracking

backport_pr: set tracking branch to remotely created branch
This commit is contained in:
Martine Lenders 2019-04-24 16:37:08 +02:00 committed by GitHub
commit 11da5e8e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,6 +192,8 @@ def main():
new_branch,
WORKTREE_SUBDIR,
"{}/{}".format(upstream_remote, release_fullname))
# transform branch name into Head object for later configuring
new_branch = repo.branches[new_branch]
try:
bp_repo = git.Repo(worktree_dir)
# Apply commits
@ -201,7 +203,8 @@ def main():
origin = _find_remote(repo, username, REPO)
print("Pushing branch {} to {}".format(new_branch, origin))
if not args.noop:
repo.git.push(origin, '{0}:{0}'.format(new_branch))
push_info = origin.push('{0}:{0}'.format(new_branch))
new_branch.set_tracking_branch(push_info[0].remote_ref)
except Exception as exc:
# Delete worktree
print("Pruning temporary workdir at {}".format(worktree_dir))