mirror of https://github.com/apache/lucene.git
Handle the case of checking out a remote branch that has never been checked out locally before
This commit is contained in:
parent
d04acc95f0
commit
74bd5d5658
|
@ -158,7 +158,11 @@ def prepareWorkspace(useGit, gitRef):
|
|||
checkoutCmd = 'git checkout %s' % gitRef
|
||||
code = run(checkoutCmd)
|
||||
if 0 != code:
|
||||
raise RuntimeError('ERROR: "%s" failed. See above.' % checkoutCmd)
|
||||
checkoutBranchCmd = 'git checkout -t -b %s origin/%s' % (gitRef, gitRef) # Checkout remote branch as new local branch
|
||||
print('"%s" failed. Trying "%s".' % (checkoutCmd, checkoutBranchCmd))
|
||||
code = run(checkoutBranchCmd)
|
||||
if 0 != code:
|
||||
raise RuntimeError('ERROR: "%s" failed. See above.' % checkoutBranchCmd)
|
||||
gitCheckoutSucceeded = True
|
||||
run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref
|
||||
|
||||
|
|
Loading…
Reference in New Issue