diff --git a/bench/utils.py b/bench/utils.py index 192ea5a0..74aeeabc 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -275,7 +275,11 @@ def update_bench(bench_repo=True, requirements=True): cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if bench_repo: - exec_cmd("git pull", cwd=cwd) + try: + exec_cmd("git pull", cwd=cwd) + except bench.utils.CommandFailedError: + exec_cmd("git stash", cwd=cwd) + logger.info("Stashing changes made at {}\nUse git stash apply to recover changes after the successful update!".format(cwd)) if requirements: update_bench_requirements()