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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
85ec3451
Commit
85ec3451
authored
Apr 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent 500 error on git blame if empty file
parent
26befdc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
app/assets/stylesheets/sections/tree.scss
app/assets/stylesheets/sections/tree.scss
+1
-1
app/views/blob/_actions.html.haml
app/views/blob/_actions.html.haml
+1
-1
lib/gitlab/git/blame.rb
lib/gitlab/git/blame.rb
+2
-1
No files found.
app/assets/stylesheets/sections/tree.scss
View file @
85ec3451
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
.tree-btn-group
{
.tree-btn-group
{
.btn
{
.btn
{
margin-right
:
-3
px
;
margin-right
:
0
px
;
padding
:
2px
10px
;
padding
:
2px
10px
;
}
}
}
}
...
...
app/views/blob/_actions.html.haml
View file @
85ec3451
...
@@ -8,5 +8,5 @@
...
@@ -8,5 +8,5 @@
-
if
current_page?
project_blame_path
(
@project
,
@id
)
-
if
current_page?
project_blame_path
(
@project
,
@id
)
=
link_to
"normal view"
,
project_blob_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"normal view"
,
project_blob_path
(
@project
,
@id
),
class:
"btn btn-tiny"
-
else
-
else
=
link_to
"blame"
,
project_blame_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"blame"
,
project_blame_path
(
@project
,
@id
),
class:
"btn btn-tiny"
unless
@blob
.
empty?
=
link_to
"history"
,
project_commits_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"history"
,
project_commits_path
(
@project
,
@id
),
class:
"btn btn-tiny"
lib/gitlab/git/blame.rb
View file @
85ec3451
...
@@ -6,13 +6,14 @@ module Gitlab
...
@@ -6,13 +6,14 @@ module Gitlab
def
initialize
(
repository
,
sha
,
path
)
def
initialize
(
repository
,
sha
,
path
)
@repository
,
@sha
,
@path
=
repository
,
sha
,
path
@repository
,
@sha
,
@path
=
repository
,
sha
,
path
end
end
def
each
def
each
raw_blame
=
Grit
::
Blob
.
blame
(
repository
.
repo
,
sha
,
path
)
raw_blame
=
Grit
::
Blob
.
blame
(
repository
.
repo
,
sha
,
path
)
raw_blame
.
each
do
|
commit
,
lines
|
raw_blame
.
each
do
|
commit
,
lines
|
next
unless
commit
commit
=
Gitlab
::
Git
::
Commit
.
new
(
commit
)
commit
=
Gitlab
::
Git
::
Commit
.
new
(
commit
)
yield
(
commit
,
lines
)
yield
(
commit
,
lines
)
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