From a670ac85804ba01de9b652093f915887d66c82e7 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 25 Jul 2023 11:07:53 +0200 Subject: [PATCH] Showing 'git push' error, if applicable, including hint for solution Fixes #385, mostly --- zest/releaser/baserelease.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zest/releaser/baserelease.py b/zest/releaser/baserelease.py index f0b8f60a..82b4e88b 100644 --- a/zest/releaser/baserelease.py +++ b/zest/releaser/baserelease.py @@ -408,7 +408,11 @@ def _push(self): default_anwer = self.zest_releaser_config.push_changes() if utils.ask("OK to push commits to the server?", default=default_anwer): for push_cmd in push_cmds: - output = execute_command(push_cmd) + output = execute_command( + push_cmd, + allow_retry=True, + fail_message="Perhaps the main branch is protected?", + ) logger.info(output) def _run_hooks(self, when):