summaryrefslogtreecommitdiff
path: root/docs/gl_objects/commits.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-01-21 16:54:16 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-01-21 17:04:00 +0100
commitee666fd57e5cb100b6e195bb74228ac242d8932a (patch)
tree58ad29ae3a7f0c113a76f2b04e0767445f3e83d5 /docs/gl_objects/commits.py
parent04435e1b13166fb45216c494f3af4d9bdb76bcaf (diff)
downloadgitlab-ee666fd57e5cb100b6e195bb74228ac242d8932a.tar.gz
Add support for commit creation
Fixes #206
Diffstat (limited to 'docs/gl_objects/commits.py')
-rw-r--r--docs/gl_objects/commits.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/gl_objects/commits.py b/docs/gl_objects/commits.py
index 3046513..2ed66f5 100644
--- a/docs/gl_objects/commits.py
+++ b/docs/gl_objects/commits.py
@@ -9,6 +9,26 @@ commits = project.commits.list(ref_name='my_branch')
commits = project.commits.list(since='2016-01-01T00:00:00Z')
# end filter list
+# create
+# See https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
+# for actions detail
+data = {
+ 'branch_name': 'master',
+ 'commit_message': 'blah blah blah',
+ 'actions': [
+ {
+ 'action': 'create',
+ 'file_path': 'blah',
+ 'content': 'blah'
+ }
+ ]
+}
+
+commit = gl.project_commits.create(data, project_id=1)
+# or
+commit = project.commits.create(data)
+# end commit
+
# get
commit = gl.project_commits.get('e3d5a71b', project_id=1)
# or