Skip to content

Commit 239f46d

Browse files
authored
fix(git): abort cherry-pick on failure
1 parent 7e5b583 commit 239f46d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

weblate/addons/git.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,14 @@ def squash_author(self, component: Component, repository: GitRepository) -> None
213213
base = repository.get_last_revision()
214214
# Cherry pick current commit (this should work
215215
# unless something is messed up)
216-
repository.execute(
217-
["cherry-pick", commit, *gpg_sign],
218-
environment={"WEBLATE_MERGE_SKIP": "1"},
219-
)
216+
try:
217+
repository.execute(
218+
["cherry-pick", commit, *gpg_sign],
219+
environment={"WEBLATE_MERGE_SKIP": "1"},
220+
)
221+
except RepositoryError:
222+
repository.execute(["cherry-pick", "--abort"])
223+
raise
220224
handled = []
221225
# Pick other commits by same author
222226
for i, other in enumerate(commits):

0 commit comments

Comments
 (0)