Let git clean fail

It exists with 1 in case the build has failed right before it (maybe it's racy..)
Let's hope this doesn't make a difference.
This commit is contained in:
Christoph Reiter 2020-08-14 22:03:58 +02:00
parent c6dc768310
commit d43b438c7c

View File

@ -62,7 +62,12 @@ def fresh_git_repo(url, path):
yield yield
finally: finally:
assert os.path.exists(path) assert os.path.exists(path)
check_call(["git", "clean", "-xfdf"], cwd=path) try:
check_call(["git", "clean", "-xfdf"], cwd=path)
except subprocess.CalledProcessError:
# sometimes it fails right after the build has failed
# not sure why
pass
check_call(["git", "reset", "--hard", "HEAD"], cwd=path) check_call(["git", "reset", "--hard", "HEAD"], cwd=path)