reset on origin/HEAD not master
Some repositories might not have a master branch or could use a different default HEAD. A git reset was made to remotes/master which would produce a stacktrace. Fix https://bugs.launchpad.net/zuul/+bug/1083154 Change-Id: Ie9390c0c5dd707d77fbfa8cff2078a9b31fd31ae Reviewed-on: https://review.openstack.org/17239 Reviewed-by: Antoine Musso <hashar@free.fr> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
b4e809edf0
commit
f2626eb384
@ -54,7 +54,8 @@ class Repo(object):
|
||||
continue
|
||||
self.repo.create_head(ref.remote_head, ref, force=True)
|
||||
|
||||
self.repo.head.reference = self.repo.heads.master
|
||||
# Reset to remote HEAD (usually origin/master)
|
||||
self.repo.head.reference = origin.refs['HEAD']
|
||||
self.repo.head.reset(index=True, working_tree=True)
|
||||
self.repo.git.clean('-x', '-f', '-d')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user