Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 5d59758

Browse files
authored
fix failure on empty pull requests (#45)
Mergifyio/git-pull-request#83 was rejected. Let's work around the issue on our side. Fixes #13.
1 parent 30ce1f9 commit 5d59758

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mozxchannel/git/pull_request.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ def create(target, target_branch, *, title, message, branch=None):
1616
env = os.environ.copy()
1717
env["EDITOR"] = "true"
1818
cmd = ["git", "-C", target, "pull-request", "--target-branch", target_branch, "--title", title, "--message", message]
19-
subprocess.run(cmd, env=env, check=True)
19+
try:
20+
subprocess.run(cmd, env=env, check=True)
21+
except subprocess.CalledProcessError as exc:
22+
# Work around https://github.com/mozilla-l10n/android-l10n-tooling/issues/13
23+
if exc.returncode == 50:
24+
print("No changes found; exiting.")
25+
else:
26+
raise exc

0 commit comments

Comments
 (0)