Apache Lucene open-source search software
LUCENE-10200: The branch does not have to be on origin remote. Replace this logic with a check whether the branch is up to date with the remote.
Dawid Weissd23f37d02df5
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.pyindex b96ec30dd25..e47edd80bd7 100755--- a/dev-tools/scripts/buildAndPushRelease.py+++ b/dev-tools/scripts/buildAndPushRelease.py@@ -84,15 +84,8 @@ def getGitRev():status = os.popen('git status').read().strip()if 'nothing to commit, working directory clean' not in status and 'nothing to commit, working tree clean' not in status:raise RuntimeError('git clone is dirty:\n\n%s' % status)- branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()- command = 'git log origin/%s..' % branch- p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)- stdout, stderr = p.communicate()- if len(stdout.strip()) > 0:- raise RuntimeError('There are unpushed commits - "%s" output is:\n\n%s' % (command, stdout.decode('utf-8')))- if len(stderr.strip()) > 0:- raise RuntimeError('Command "%s" failed:\n\n%s' % (command, stderr.decode('utf-8')))-+ if 'Your branch is ahead of' in status:+ raise RuntimeError('Your local branch is ahead of the remote? git status says:\n%s' % status)print(' git clone is clean')else:print(' Ignoring dirty git clone due to dev-mode')