Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
373092e6
Commit
373092e6
authored
Jan 30, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update API
parent
83e19b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
lib/api/commits.rb
lib/api/commits.rb
+5
-0
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+6
-0
No files found.
lib/api/commits.rb
View file @
373092e6
...
...
@@ -70,6 +70,11 @@ module API
if
result
[
:status
]
==
:success
commit_detail
=
user_project
.
repository
.
commit
(
result
[
:result
])
if
verified_request?
&&
current_request
.
env
[
'warden'
]
&
.
authenticate
::
Gitlab
::
Metrics
::
MultiFileEditor
.
new
(
user_project
,
current_user
,
commit_detail
).
record
end
present
commit_detail
,
with:
Entities
::
CommitDetail
else
render_api_error!
(
result
[
:message
],
400
)
...
...
spec/requests/api/commits_spec.rb
View file @
373092e6
...
...
@@ -245,6 +245,12 @@ describe API::Commits do
expect
(
json_response
[
'committer_email'
]).
to
eq
(
user
.
email
)
end
it
'does not call the metrics using access token authentication'
do
post
api
(
url
,
user
),
valid_c_params
expect_any_instance_of
(
::
Gitlab
::
Metrics
::
MultiFileEditor
).
not_to
receive
(
:record
)
end
it
'returns a 400 bad request if file exists'
do
post
api
(
url
,
user
),
invalid_c_params
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment