Commit e76e9f6c authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Case of missing remote origin branch

parent d9bd4420
......@@ -136,11 +136,13 @@ def main():
else:
debian_branch = "debian-" + branch
try:
repo.references[debian_branch]
except IndexError:
# Branch does not exist
repo.git.branch("--track", debian_branch, "origin/" + debian_branch)
if not debian_branch in repo.references:
# Branch does not exist!
if "origin/" + debian_branch in repo.references:
remote = "origin/" + debian_branch
else:
remote = "origin/debian-develop"
repo.git.branch("--track", debian_branch, remote)
repo.git.checkout(debian_branch)
print_green("Changed to branch '%s'" % debian_branch)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment