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
Jérome Perrin
gitlab-ce
Commits
26c8e0b3
Commit
26c8e0b3
authored
Dec 16, 2016
by
Jeff Stubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 500 error for invalid path when visiting blame page
Closes #25761.
parent
546fa165
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
app/controllers/projects/blame_controller.rb
app/controllers/projects/blame_controller.rb
+3
-0
changelogs/unreleased/fix-blame-500.yml
changelogs/unreleased/fix-blame-500.yml
+4
-0
spec/controllers/projects/blame_controller_spec.rb
spec/controllers/projects/blame_controller_spec.rb
+5
-0
No files found.
app/controllers/projects/blame_controller.rb
View file @
26c8e0b3
...
...
@@ -8,6 +8,9 @@ class Projects::BlameController < Projects::ApplicationController
def
show
@blob
=
@repository
.
blob_at
(
@commit
.
id
,
@path
)
return
render_404
unless
@blob
@blame_groups
=
Gitlab
::
Blame
.
new
(
@blob
,
@commit
).
groups
end
end
changelogs/unreleased/fix-blame-500.yml
0 → 100644
View file @
26c8e0b3
---
title
:
Fix blame 500 error on invalid path.
merge_request
:
25761
author
:
Jeff Stubler
spec/controllers/projects/blame_controller_spec.rb
View file @
26c8e0b3
...
...
@@ -25,5 +25,10 @@ describe Projects::BlameController do
let
(
:id
)
{
'master/files/ruby/popen.rb'
}
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
context
"invalid file"
do
let
(
:id
)
{
'master/files/ruby/missing_file.rb'
}
it
{
expect
(
response
).
to
have_http_status
(
404
)
}
end
end
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