Browse Source

Merge "Fix checkout when preparing a ref"

changes/77/43977/1
Jenkins 9 years ago committed by Gerrit Code Review
parent
commit
99648b3b74
  1. 10
      zuul/merger.py

10
zuul/merger.py

@ -63,15 +63,13 @@ class Repo(object):
def checkout(self, ref):
self._ensure_cloned()
self.log.debug("Checking out %s" % ref)
self.log.debug(repr(ref))
self.repo.head.reset(index=True, working_tree=True)
self.repo.git.clean('-x', '-f', '-d')
if self.repo.re_hexsha_only.match(ref):
self.repo.head.reference = ref
self.repo.git.checkout(ref)
else:
self.fetch(ref)
self.repo.head.reference = \
self.repo.remotes.origin.refs[ref].commit.hexsha
self.repo.head.reset(index=True, working_tree=True)
self.repo.git.clean('-x', '-f', '-d')
self.repo.git.checkout("FETCH_HEAD")
def cherryPick(self, ref):
self._ensure_cloned()

Loading…
Cancel
Save