Class: EacGit::Local::Commit::ChangedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_git/local/commit/changed_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commit, diff_tree_line) ⇒ ChangedFile

Returns a new instance of ChangedFile.

Parameters:

  • commit (EacGit::Local::Commit)
  • diff_tree_line (String)

    A line from command “repo diff-tree –no-commit-id -r –full-index”‘s output.



14
15
16
17
# File 'lib/eac_git/local/commit/changed_file.rb', line 14

def initialize(commit, diff_tree_line)
  @commit = commit
  @diff_tree = ::EacGit::Local::Commit::DiffTreeLine.new(diff_tree_line)
end

Instance Attribute Details

#commitObject (readonly)

Returns the value of attribute commit.



9
10
11
# File 'lib/eac_git/local/commit/changed_file.rb', line 9

def commit
  @commit
end

#diff_treeObject (readonly)

Returns the value of attribute diff_tree.



9
10
11
# File 'lib/eac_git/local/commit/changed_file.rb', line 9

def diff_tree
  @diff_tree
end

Instance Method Details

#dst_size_uncachedObject



29
30
31
# File 'lib/eac_git/local/commit/changed_file.rb', line 29

def dst_size_uncached
  size(dst_sha1)
end

#src_size_uncachedObject



25
26
27
# File 'lib/eac_git/local/commit/changed_file.rb', line 25

def src_size_uncached
  size(src_sha1)
end

#to_sObject



21
22
23
# File 'lib/eac_git/local/commit/changed_file.rb', line 21

def to_s
  "#{path}|#{status}"
end