Commit 332f9244 authored by Jérome Perrin's avatar Jérome Perrin

testnode: do not fail when switching back to a previously used branch

parent 7b27ed27
...@@ -205,6 +205,9 @@ class Updater(object): ...@@ -205,6 +205,9 @@ class Updater(object):
self._git('fetch', '--all', '--prune') self._git('fetch', '--all', '--prune')
if self.branch and \ if self.branch and \
not ("* %s" % self.branch in self._git('branch').split("\n")): not ("* %s" % self.branch in self._git('branch').split("\n")):
# Delete branch if already exists
if self.branch in self._git('branch'):
self._git('branch', '-D', self.branch)
self._git('checkout', 'origin/%s' % self.branch, '-b', self._git('checkout', 'origin/%s' % self.branch, '-b',
self.branch) self.branch)
self._git('update-index', '--refresh') # see note above self._git('update-index', '--refresh') # see note above
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment