Sha256: 62e4c4ecd4005d5425dd8591a42291ccd10f4aeae2067cbfe08b102caef76ae8
Contents?: true
Size: 719 Bytes
Versions: 4
Compression:
Stored size: 719 Bytes
Contents
module Dandelion class Tree attr_reader :commit def initialize(repo, commit) @repo = repo @commit = commit end def is_symlink?(path) # https://github.com/libgit2/libgit2/blob/development/include/git2/types.h @commit.tree.path(path)[:filemode] == 0120000 end def data(path) submodule = @repo.submodules[path] if submodule # TODO nil else info, obj = object(path) blob_content(obj) end end private def object(path) info = @commit.tree.path(path) object = @repo.lookup(info[:oid]) [info, object] end def blob_content(object) object.read_raw.data end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
dandelion-0.5.3 | lib/dandelion/tree.rb |
dandelion-0.5.2 | lib/dandelion/tree.rb |
dandelion-0.5.1 | lib/dandelion/tree.rb |
dandelion-0.5.0 | lib/dandelion/tree.rb |