class ReaPack::Index::Git::Diff

Attributes

status[R]

Public Class Methods

new(delta, repo) click to toggle source
# File lib/reapack/index/git.rb, line 210
def initialize(delta, repo)
  @delta, @repo = delta, repo

  @status = delta.status.to_sym
  @file = delta.new_file
end

Public Instance Methods

file() click to toggle source
# File lib/reapack/index/git.rb, line 219
def file
  @path ||= @file[:path].force_encoding(Encoding::UTF_8)
end
new_content() click to toggle source
# File lib/reapack/index/git.rb, line 223
def new_content
  return if status == :deleted
  @new_content ||=
    @repo.lookup(@file[:oid]).content.force_encoding(Encoding::UTF_8)
end
new_header() click to toggle source
# File lib/reapack/index/git.rb, line 229
def new_header
  @new_header ||= ReaPack::Index.parse @new_content if new_content
end