Clean git repo before checkout
Sometimes git repo become unusable - it contains a lot of untracked files. Due to this the following checkout fails and none of commits processed. The solution is to reset the state and clean all untracked files. Change-Id: Id230147ac3bfe739ad8be45a7f87da59807fcea4
This commit is contained in:
parent
cecabdab57
commit
95e9cb639b
@ -95,6 +95,8 @@ class Git(Vcs):
|
||||
|
||||
def _checkout(self, branch):
|
||||
try:
|
||||
sh.git('clean', '-d', '--force')
|
||||
sh.git('reset', '--hard')
|
||||
sh.git('checkout', 'origin/' + branch)
|
||||
return True
|
||||
except sh.ErrorReturnCode as e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user