diff --git a/dist/tools/backport_pr/backport_pr.py b/dist/tools/backport_pr/backport_pr.py index 281ccb11db..bb84371230 100755 --- a/dist/tools/backport_pr/backport_pr.py +++ b/dist/tools/backport_pr/backport_pr.py @@ -193,7 +193,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))