Skip to content

Commit 3d048bd

Browse files
committed
try catch for submodules we can't push to
1 parent 967ef10 commit 3d048bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

release_scripts/branches.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
import sys
66
import xml.etree.ElementTree as ET
7+
from git import GitCommandError
78
from typing import Any, List
89

910
import git
@@ -205,7 +206,10 @@ def push(self, submodules: bool = False) -> None:
205206
if submodules:
206207
for submodule in self.repo.submodules:
207208
logging.info(f"Pushing to submodule '{submodule.module().remote().url}'.")
208-
submodule.module().git.push("origin", self.branch_name)
209+
try:
210+
submodule.module().git.push("origin", self.branch_name)
211+
except GitCommandError:
212+
logging.exception("Failed to push to %s: ", submodule.module().remote().url)
209213

210214
self.repo.git.push("origin", self.branch_name)
211215

0 commit comments

Comments
 (0)