class Gitlab::Git::Blame

Attributes

path[RW]
repository[RW]
sha[RW]

Public Class Methods

new(repository, sha, path) click to toggle source
# File lib/gitlab_git/blame.rb, line 6
def initialize(repository, sha, path)
  @repository, @sha, @path = repository, sha, path
end

Public Instance Methods

each() { |commit, lines| ... } click to toggle source
# File lib/gitlab_git/blame.rb, line 10
def each
  raw_blame = Grit::Blob.blame(repository.raw, sha, path)

  raw_blame.each do |commit, lines|
    next unless commit

    commit = Gitlab::Git::Commit.new(commit)
    yield(commit, lines)
  end
end