clone: Don’t check out the Debian branch if it doesn’t exist
authorAndrej Shadura <andrew.shadura@collabora.co.uk>
Sun, 7 Feb 2021 18:31:23 +0000 (19:31 +0100)
committerGuido Günther <agx@sigxcpu.org>
Thu, 18 Feb 2021 20:31:36 +0000 (21:31 +0100)
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
gbp/scripts/clone.py

index b17241b6c76a4e4f74250b46e3ed03be123ec0ee..7894b618dd8dde26a2375bfe896c11696d6739fc 100755 (executable)
@@ -204,7 +204,8 @@ def main(argv):
                         not repo.has_branch(branch)):
                     repo.create_branch(branch, remote)
 
-        repo.set_branch(options.debian_branch)
+        if repo.has_branch(options.debian_branch, remote=True):
+            repo.set_branch(options.debian_branch)
 
         repo_setup.set_user_name_and_email(options.repo_user, options.repo_email, repo)