Commit 51c16755 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

added Gitlab::Git::Blame for git blame feature

parent 22817398
module Gitlab
module Git
class Blame
attr_accessor :repository, :sha, :path
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|
commit = Gitlab::Git::Commit.new(commit)
yield(commit, lines)
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment