Skip to content

Commit b77b945

Browse files
committed
fix: return response with commit data
1 parent ad3e833 commit b77b945

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

gitlab/v4/objects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2148,10 +2148,13 @@ def revert(self, branch, **kwargs):
21482148
Raises:
21492149
GitlabAuthenticationError: If authentication is not correct
21502150
GitlabRevertError: If the revert could not be performed
2151+
2152+
Returns:
2153+
dict: The new commit data (*not* a RESTObject)
21512154
"""
21522155
path = "%s/%s/revert" % (self.manager.path, self.get_id())
21532156
post_data = {"branch": branch}
2154-
self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
2157+
return self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
21552158

21562159

21572160
class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager):

tools/python_test_v4.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,12 @@
463463
# assert len(discussion.attributes["notes"]) == 1
464464

465465
# Revert commit
466-
commit.revert(branch="master")
467-
revert_commit = admin_project.commits.list()[0]
466+
revert_commit = commit.revert(branch="master")
468467

469468
expected_message = 'Revert "{}"\n\nThis reverts commit {}'.format(
470469
commit.message, commit.id
471470
)
472-
assert revert_commit.message == expected_message
471+
assert revert_commit["message"] == expected_message
473472

474473
try:
475474
commit.revert(branch="master")

0 commit comments

Comments
 (0)