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.



17
18
19
20
# File 'lib/eac_git/local/commit/changed_file.rb', line 17

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.



12
13
14
# File 'lib/eac_git/local/commit/changed_file.rb', line 12

def commit
  @commit
end

#diff_treeObject (readonly)

Returns the value of attribute diff_tree.



12
13
14
# File 'lib/eac_git/local/commit/changed_file.rb', line 12

def diff_tree
  @diff_tree
end

Instance Method Details

#dst_size_uncachedObject



32
33
34
# File 'lib/eac_git/local/commit/changed_file.rb', line 32

def dst_size_uncached
  size(dst_sha1)
end

#src_size_uncachedObject



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

def src_size_uncached
  size(src_sha1)
end

#to_sObject



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

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