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)