]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script: enable checkout of specific sha1 as base 54338/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 3 Nov 2023 17:46:08 +0000 (13:46 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 10 Nov 2023 15:02:14 +0000 (10:02 -0500)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/script/ptl-tool.py

index 095fceb41fc0445c0e2647a2f5c5287d19c0dfeb..176f61f22c8c786555a86a3468aed38a277dea30 100755 (executable)
@@ -302,12 +302,13 @@ def build_branch(args):
         try:
             base_path = args.base_path + base
             base = next(ref for ref in G.refs if ref.path == base_path)
+            # So we know that we're not on an old test branch, detach HEAD onto ref:
+            base.checkout()
         except StopIteration:
-            log.error("Branch " + base + " does not exist!")
-            sys.exit(1)
-
-        # So we know that we're not on an old test branch, detach HEAD onto ref:
-        base.checkout()
+            log.info(f"Trying to checkout uninterpreted base {base}")
+            c = G.commit(base)
+            G.git.checkout(c)
+        assert G.head.is_detached
 
     for pr in prs:
         pr = int(pr)