From ae5d61bfd5e8f32008caa95a32010f0118a456cc Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 6 Oct 2017 11:52:04 -0700 Subject: [PATCH] ptl-tool: checkout branch after creation Signed-off-by: Patrick Donnelly --- src/script/ptl-tool.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index cb754101e3f..083e551a8fa 100755 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@ -231,16 +231,8 @@ def build_branch(args): if branch == 'HEAD': log.info("Leaving HEAD detached; no branch anchors your commits") else: - # Delete test branch if it already existed - try: - getattr(G.branches, branch).delete( - G, getattr(G.branches, branch), force=True) - log.info("Deleted old test branch %s" % branch) - except AttributeError: - pass - - G.create_head(branch) - log.info("Created branch {branch}".format(branch=branch)) + G.head.reference = G.create_head(branch, force=True) + log.info("Checked out new branch {branch}".format(branch=branch)) # tag it for future reference. for i in range(0, 100):