Sha256: 659a010129f8281815d9bf3427fa85348ae0893338d0351a66c68d27bd976710
Contents?: true
Size: 615 Bytes
Versions: 14
Compression:
Stored size: 615 Bytes
Contents
module Gitlab module Git class Blame def initialize(repository, sha, path) @repo = repository.rugged @blame = Rugged::Blame.new(@repo, path) @blob = @repo.blob_at(sha, path) @lines = @blob.content.split("\n") end def each @blame.each do |blame| from = blame[:final_start_line_number] - 1 commit = @repo.lookup(blame[:final_commit_id]) yield(Gitlab::Git::Commit.new(commit), @lines[from, blame[:lines_in_hunk]] || [], blame[:final_start_line_number]) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems