Class: MultiGit::JGitBackend::Tree

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

Constant Summary collapse

EMPTY_BYTES =
[].to_java :byte

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



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/multi_git/jgit_backend/tree.rb', line 13

def raw_entries
  return @raw_entries if @raw_entries
  repository.use_reader do |reader|
    entries = []
    it = CanonicalTreeParser.new(EMPTY_BYTES, reader, java_oid)
    until it.eof
      mode = it.getEntryRawMode
      entries << [it.getEntryPathString, mode, ObjectId.toString(it.getEntryObjectId)]
      it.next
    end
    @raw_entries = entries
  end
  return @raw_entries
end