File tree 1 file changed +9
-3
lines changed 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,22 @@ def _push(self, working_repo: Optional[Repo] = None) -> None:
104
104
old_ssh_auth_sock = os .getenv ("SSH_AUTH_SOCK" )
105
105
os .environ ["SSH_AUTH_SOCK" ] = KEYHOLDER_SOCK
106
106
107
- try :
107
+ try : # pylint: disable=too-many-nested-blocks
108
108
for remote in working_repo .remotes :
109
109
logger .debug ("Attempt push to: %s" , remote )
110
110
try :
111
111
# TODO: later versions of git python have raise_if_error
112
112
push_info_list = remote .push ()
113
113
for push_info in push_info_list :
114
114
msg = f"bitflags { push_info .flags } : { push_info .summary .strip ()} "
115
- if push_info .flags & PushInfo .ERROR == PushInfo .ERROR :
116
- raise RepoSyncPushError (f"Error pushing to { remote } : { msg } " )
115
+ for flag in [
116
+ PushInfo .REJECTED ,
117
+ PushInfo .REMOTE_REJECTED ,
118
+ PushInfo .REMOTE_FAILURE ,
119
+ PushInfo .ERROR ,
120
+ ]:
121
+ if push_info .flags & flag :
122
+ raise RepoSyncPushError (f"Error pushing to { remote } : { msg } " )
117
123
# remote.push returns an empty list on error
118
124
except (StopIteration , GitError ) as error :
119
125
raise RepoSyncPushError (f"Error pushing to { remote } : { error } " ) from error
You can’t perform that action at this time.
0 commit comments