- if current_page? project_blame_path(@project, @id)
= link_to "normal view", project_blob_path(@project, @id), class: "btn btn-tiny"
- 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"
def initialize(repository, sha, path)
@repository, @sha, @path = repository, sha, path
-
end
def each
raw_blame = Grit::Blob.blame(repository.repo, sha, path)
raw_blame.each do |commit, lines|
+ next unless commit
+
commit = Gitlab::Git::Commit.new(commit)
yield(commit, lines)
end