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
21d33e85
Commit
21d33e85
authored
Aug 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
514e976b
535c2d3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
changelogs/unreleased/fix-commits-api-empty-refname.yml
changelogs/unreleased/fix-commits-api-empty-refname.yml
+5
-0
lib/api/commits.rb
lib/api/commits.rb
+1
-1
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+6
-0
No files found.
changelogs/unreleased/fix-commits-api-empty-refname.yml
0 → 100644
View file @
21d33e85
---
title
:
Fix 500 errors in commits api caused by empty ref_name parameter
merge_request
:
author
:
type
:
fixed
lib/api/commits.rb
View file @
21d33e85
...
...
@@ -43,7 +43,7 @@ module API
path
=
params
[
:path
]
before
=
params
[
:until
]
after
=
params
[
:since
]
ref
=
params
[
:ref_name
]
||
user_project
.
try
(
:default_branch
)
||
'master'
unless
params
[
:all
]
ref
=
params
[
:ref_name
]
.
presence
||
user_project
.
try
(
:default_branch
)
||
'master'
unless
params
[
:all
]
offset
=
(
params
[
:page
]
-
1
)
*
params
[
:per_page
]
all
=
params
[
:all
]
with_stats
=
params
[
:with_stats
]
...
...
spec/requests/api/commits_spec.rb
View file @
21d33e85
...
...
@@ -126,6 +126,12 @@ describe API::Commits do
end
end
context
"with empty ref_name parameter"
do
let
(
:route
)
{
"/projects/
#{
project_id
}
/repository/commits?ref_name="
}
it_behaves_like
'project commits'
end
context
"path optional parameter"
do
it
"returns project commits matching provided path parameter"
do
path
=
'files/ruby/popen.rb'
...
...
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