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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
22d5d891
Commit
22d5d891
authored
Jun 05, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
1498de22
b7d20f14
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
CHANGELOG
CHANGELOG
+1
-0
lib/api/commits.rb
lib/api/commits.rb
+1
-1
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+2
-1
No files found.
CHANGELOG
View file @
22d5d891
...
...
@@ -139,6 +139,7 @@ v 7.10.4
- Fix DB error when trying to tag a repository (Stan Hu)
- Fix Error 500 when searching Wiki pages (Stan Hu)
- Unescape branch names in compare commit (Stan Hu)
- Order commit comments chronologically in API.
v 7.10.2
- Fix CI links on MR page
...
...
lib/api/commits.rb
View file @
22d5d891
...
...
@@ -62,7 +62,7 @@ module API
sha
=
params
[
:sha
]
commit
=
user_project
.
commit
(
sha
)
not_found!
'Commit'
unless
commit
notes
=
Note
.
where
(
commit_id:
commit
.
id
)
notes
=
Note
.
where
(
commit_id:
commit
.
id
)
.
order
(
:created_at
)
present
paginate
(
notes
),
with:
Entities
::
CommitNote
end
...
...
spec/requests/api/commits_spec.rb
View file @
22d5d891
...
...
@@ -9,6 +9,7 @@ describe API::API, api: true do
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:guest
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
GUEST
)
}
let!
(
:note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'a comment on a commit'
)
}
let!
(
:another_note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'another comment on a commit'
)
}
before
{
project
.
team
<<
[
user
,
:reporter
]
}
...
...
@@ -89,7 +90,7 @@ describe API::API, api: true do
get
api
(
"/projects/
#{
project
.
id
}
/repository/commits/
#{
project
.
repository
.
commit
.
id
}
/comments"
,
user
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
length
).
to
eq
(
1
)
expect
(
json_response
.
length
).
to
eq
(
2
)
expect
(
json_response
.
first
[
'note'
]).
to
eq
(
'a comment on a commit'
)
expect
(
json_response
.
first
[
'author'
][
'id'
]).
to
eq
(
user
.
id
)
end
...
...
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