Skip to content

Commit 90c6b7c

Browse files
committed
Fix exception when merging with empty commit message
Fixes sigmavirus24#370 The GitHub API now requires a param `commit_message` with an empty value '' when merging a pull request. In such case the default value is used as a commit message. Providing an empty data string no longer works. (cherry picked from commit 39c06c9) Conflicts: tests/unit/test_pulls.py The test file was not backported because it doesn't exist on the destination branch.
1 parent e1d7b17 commit 90c6b7c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

github3/pulls.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ def merge(self, commit_message=''):
307307
merge commit
308308
:returns: bool
309309
"""
310-
data = None
311-
if commit_message:
312-
data = dumps({'commit_message': commit_message})
310+
data = dumps({'commit_message': commit_message})
313311
url = self._build_url('merge', base_url=self._api)
314312
json = self._json(self._put(url, data=data), 200)
315313
self.merge_commit_sha = json['sha']

0 commit comments

Comments
 (0)