From b41b316b023db98b628dcbb0d7944833237a66a8 Mon Sep 17 00:00:00 2001 From: Eduard Carrerars Date: Fri, 5 Nov 2021 13:07:21 +0100 Subject: [PATCH] Try to fix CONFLICT on pop --- apply_pr/fabfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apply_pr/fabfile.py b/apply_pr/fabfile.py index d644e94..aa18a36 100644 --- a/apply_pr/fabfile.py +++ b/apply_pr/fabfile.py @@ -186,6 +186,11 @@ def apply(diff, stash=True, reject=False, message=None): if stash and stashed: print(colors.yellow('Unstashing...')) sudo("git stash pop") + error_on_pop = sudo("test -f .gitignore && git ls-files -om -X .gitignore || git ls-files -u") + if error_on_pop: + sudo("git reset --merge") + print(colors.red('\U000026D4 Error on stash pop. Keeping stash...')) + raise class GitApplier(object):