Class: MultiGit::GitBackend::Tree

Inherits:
Object
  • Object
show all
Includes:
Tree
Defined in:
lib/multi_git/git_backend/tree.rb

Constant Summary collapse

LS_TREE_REGEX =
/^([0-7]{6}) (?:blob|tree|commit) (\h{40})\t(.+)$/

Instance Attribute Summary

Attributes included from Object

#oid, #repository

Instance Method Summary collapse

Methods included from Tree

#to_builder, #with_parent

Methods included from Object

#bytesize, #content, #to_builder, #to_io

Methods included from Utils::AbstractMethods

#abstract

Methods included from Tree::Base

#==, #each, #entries, #entry, #glob, #hash, #key?, #names, #size, #traverse, #type

Methods included from Walkable

#walk

Instance Method Details

#raw_entriesObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/multi_git/git_backend/tree.rb', line 10

def raw_entries
  @raw_entries ||= begin
    @git.call('ls-tree', oid) do |stdout|
      stdout.each_line.map do |line|
        raise unless LS_TREE_REGEX =~ line
        [$3,$1.to_i(8),$2]
      end
    end
  end
end