diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-11 22:17:38 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-11 22:17:38 +0300 |
commit | 50dfcaa047ae862ad9b6ae05622a5d2bfa5f1139 (patch) | |
tree | e69ffb7db222cdd837c60caa60287d3ec941f898 | |
parent | cecff24a82e0cd31c4585df2cfb3004e0de1e2e0 (diff) | |
download | ick2-50dfcaa047ae862ad9b6ae05622a5d2bfa5f1139.tar.gz |
Fix: clean up before pulling
In case the work tree is dirty.
-rw-r--r-- | pipelines/get_sources.ick | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pipelines/get_sources.ick b/pipelines/get_sources.ick index 7d68c81..552649f 100644 --- a/pipelines/get_sources.ick +++ b/pipelines/get_sources.ick @@ -54,6 +54,8 @@ pipelines: ref_is_sha = re.match('^[a-fA-F0-9]+$', ref) is not None mirror = os.path.join('.mirrors', name) if os.path.exists(dirname): + RUN('git', 'clean', '-fdx', cwd=dirname) + RUN('git', 'reset', '--hard', cwd=dirname) RUN('git', 'checkout', ref, cwd=dirname) # Only pull if in a branch. head = open('{}/.git/HEAD'.format(dirname)).read().strip() |