Skip to content

Commit e662321

Browse files
committed
fix(add-ons): skip empty commits in cherry-pick
These might be result of merging/rebasing changes upstream. Fixes WEBLATE-37ZV
1 parent 4aeecb2 commit e662321

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

docs/changes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ Weblate 5.17
1313

1414
.. rubric:: Bug fixes
1515

16+
* :ref:`addon-weblate.git.squash` better handle commits applied upstream.
17+
1618
.. rubric:: Compatibility
1719

1820
* Dropped support for MySQL and MariaDB as the database engine.
1921
* Weblate now requires Django 6.0.
22+
* Weblate now requires Git 2.45 or newer.
2023

2124
.. rubric:: Upgrading
2225

weblate/addons/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def squash_author(self, component: Component, repository: GitRepository) -> None
214214
# Cherry pick current commit (this should work
215215
# unless something is messed up)
216216
repository.execute(
217-
["cherry-pick", commit, *gpg_sign],
217+
["cherry-pick", "--empty=drop", commit, *gpg_sign],
218218
environment={"WEBLATE_MERGE_SKIP": "1"},
219219
)
220220
handled = []
@@ -224,7 +224,7 @@ def squash_author(self, component: Component, repository: GitRepository) -> None
224224
continue
225225
try:
226226
repository.execute(
227-
["cherry-pick", other[0], *gpg_sign],
227+
["cherry-pick", "--empty=drop", other[0], *gpg_sign],
228228
environment={"WEBLATE_MERGE_SKIP": "1"},
229229
)
230230
handled.append(i)

weblate/vcs/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class GitRepository(Repository):
105105
push_label: ClassVar[StrOrPromise] = gettext_lazy(
106106
"This will push changes to the upstream Git repository."
107107
)
108-
req_version: ClassVar[str | None] = "2.28"
108+
req_version: ClassVar[str | None] = "2.45"
109109
default_branch: ClassVar[str] = "master"
110110
ref_to_remote: ClassVar[str] = "..{0}"
111111
ref_from_remote: ClassVar[str] = "{0}.."

0 commit comments

Comments
 (0)