Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix branch test for merge script.
Browse files Browse the repository at this point in the history
Failing calls to show-ref cause an exception in python.

BUG=chromium:451975
TBR=tandrii@chromium.org
NOTRY=true
LOG=n

TEST=./script_test.py

Review URL: https://codereview.chromium.org/933523003

Cr-Commit-Position: refs/heads/master@{#26684}
  • Loading branch information
mi-ac authored and Commit bot committed Feb 17, 2015
1 parent b85cd71 commit b8ade81
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tools/release/common_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,18 @@ def RemoteBranch(self, name):
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):
Expand Down

0 comments on commit b8ade81

Please sign in to comment.