summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2020-02-19 00:30:48 +0100
committerNejc Habjan <hab.nejc@gmail.com>2020-02-19 00:30:48 +0100
commitb77b945c7e0000fad4c422a5331c7e905e619a33 (patch)
treee82aec1111c26849470b4567bafdab848f8d152a
parentad3e833671c49db194c86e23981215b13b96bb1d (diff)
downloadgitlab-b77b945c7e0000fad4c422a5331c7e905e619a33.tar.gz
fix: return response with commit data
-rw-r--r--gitlab/v4/objects.py5
-rw-r--r--tools/python_test_v4.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 8b94f07..83f77d3 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -2148,10 +2148,13 @@ class ProjectCommit(RESTObject):
Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabRevertError: If the revert could not be performed
+
+ Returns:
+ dict: The new commit data (*not* a RESTObject)
"""
path = "%s/%s/revert" % (self.manager.path, self.get_id())
post_data = {"branch": branch}
- self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
+ return self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager):
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py
index f5d5df0..49f99e5 100644
--- a/tools/python_test_v4.py
+++ b/tools/python_test_v4.py
@@ -463,13 +463,12 @@ discussion = commit.discussions.get(discussion.id)
# assert len(discussion.attributes["notes"]) == 1
# Revert commit
-commit.revert(branch="master")
-revert_commit = admin_project.commits.list()[0]
+revert_commit = commit.revert(branch="master")
expected_message = 'Revert "{}"\n\nThis reverts commit {}'.format(
commit.message, commit.id
)
-assert revert_commit.message == expected_message
+assert revert_commit["message"] == expected_message
try:
commit.revert(branch="master")