Index: tools/release/common_includes.py |
diff --git a/tools/release/common_includes.py b/tools/release/common_includes.py |
index 03b0c5b7d49fc3fe9d4149523e5da2b4af5c86af..bae05bc6b542a2c41d4bb9773bc8ecfc3fc97068 100644 |
--- a/tools/release/common_includes.py |
+++ b/tools/release/common_includes.py |
@@ -338,12 +338,18 @@ class GitInterface(VCInterface): |
return name |
if name in ["candidates", "master"]: |
return "refs/remotes/origin/%s" % name |
- # Check if branch is in heads. |
- if self.step.Git("show-ref refs/remotes/origin/%s" % name).strip(): |
- return "refs/remotes/origin/%s" % name |
- # Check if branch is in branch-heads. |
- if self.step.Git("show-ref refs/remotes/branch-heads/%s" % name).strip(): |
- return "refs/remotes/branch-heads/%s" % name |
+ try: |
+ # Check if branch is in heads. |
+ if self.step.Git("show-ref refs/remotes/origin/%s" % name).strip(): |
+ return "refs/remotes/origin/%s" % name |
+ except GitFailedException: |
+ pass |
+ try: |
+ # Check if branch is in branch-heads. |
+ if self.step.Git("show-ref refs/remotes/branch-heads/%s" % name).strip(): |
+ return "refs/remotes/branch-heads/%s" % name |
+ except GitFailedException: |
+ pass |
self.Die("Can't find remote of %s" % name) |
def Tag(self, tag, remote, message): |