look for patches on origin/master or master

When the branch for the series does not exist, look on 'origin/master'
as well as 'master' because depending on how the repo is cloned we
might not have a branch called 'master'.

Change-Id: I6abc0b0b3a1657211a01b80547602bbbe83f065e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-11-15 17:50:18 -05:00
parent 77e0060f62
commit fece255a3c

View File

@ -206,13 +206,20 @@ def check_branch_sha(workdir, repo, series, sha):
cwd=os.path.join(workdir, repo),
).decode('utf-8')
)
if (remote_match not in all_branches) and ('master' in containing_branches):
LOG.debug('did not find %s but SHA is on master', remote_match)
return True
if remote_match not in all_branches:
if 'master' in containing_branches:
LOG.debug('did not find %s but SHA is on master',
remote_match)
return True
if 'origin/master' in containing_branches:
LOG.debug('did not find %s but SHA is on origin/master',
remote_match)
return True
# At this point we know the release is not from the required
# branch and it is not from master, which means it is the
# wrong branch and should not be allowed.
LOG.debug('did not find SHA on %s or master', remote_match)
LOG.debug('did not find SHA on %s or master or origin/master',
remote_match)
return False
except subprocess.CalledProcessError as e:
LOG.error('failed checking SHA on branch: %s [%s]' % (e, e.output.strip()))