1 require 'git/internal/object'
2 require 'git/internal/pack'
3 require 'git/internal/loose'
8 def initialize(git_dir)
10 @loose = Internal::LooseStorage.new(git_path("objects"))
16 return "#@git_dir/#{path}"
19 def get_object_by_sha1(sha1)
20 r = get_raw_object_by_sha1(sha1)
22 Object.from_raw(r, self)
25 def get_raw_object_by_sha1(sha1)
26 sha1 = [sha1].pack("H*")
38 # try packs again, maybe the object got packed in the meantime
53 Dir.open(git_path("objects/pack/")) do |dir|
55 if entry =~ /\.pack$/i
56 @packs << Git::Internal::PackStorage.new(git_path("objects/pack/" \