From dddf48b57b580c4a0adc49bde940484c1a8643b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=BChnel?= Date: Mon, 21 Oct 2019 22:41:37 +0200 Subject: [PATCH] added fallback for applying patch --- scripts/phabtalk/apply_patch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/phabtalk/apply_patch.py b/scripts/phabtalk/apply_patch.py index 7d6d5af..3fe3a22 100755 --- a/scripts/phabtalk/apply_patch.py +++ b/scripts/phabtalk/apply_patch.py @@ -37,7 +37,10 @@ def _get_parent_hash(diff_id: str, phab:Phabricator) -> str: def _git_checkout(git_hash:str): - subprocess.check_call('git reset --hard {}'.format(git_hash), shell=True) + try: + subprocess.check_call('git reset --hard {}'.format(git_hash), shell=True) + except CalledProcessError: + subprocess.check_call('git checkout master') subprocess.check_call('git clean -fdx', shell=True)