Dont show '0 additions and 0 deletions' message for commit
This commit is contained in:
parent
ad5ea14210
commit
5f9d654939
2 changed files with 12 additions and 5 deletions
|
@ -172,4 +172,10 @@ class Commit
|
|||
lines.pop if lines.last == "-- " # end of diff
|
||||
lines.join("\n")
|
||||
end
|
||||
|
||||
def has_zero_stats?
|
||||
stats.total.zero?
|
||||
rescue
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
= render "commit_box"
|
||||
|
||||
%p.pull-right.cgray
|
||||
This commit has
|
||||
%span.cgreen #{@commit.stats.additions} additions
|
||||
and
|
||||
%span.cred #{@commit.stats.deletions} deletions
|
||||
- unless @commit.has_zero_stats?
|
||||
%p.pull-right.cgray
|
||||
This commit has
|
||||
%span.cgreen #{@commit.stats.additions} additions
|
||||
and
|
||||
%span.cred #{@commit.stats.deletions} deletions
|
||||
|
||||
= render "commits/diffs", diffs: @commit.diffs
|
||||
= render "notes/notes_with_form"
|
||||
|
|
Loading…
Reference in a new issue