]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ptl-tool: checkout branch after creation 18157/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 6 Oct 2017 18:52:04 +0000 (11:52 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 6 Oct 2017 18:52:04 +0000 (11:52 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/script/ptl-tool.py

index cb754101e3fde6a2c105b1e4603bd52b20060b63..083e551a8fa900a203906c6988644f3ecefbcb10 100755 (executable)
@@ -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):