Method: Dockly::Util::Git.ls_files

Defined in:
lib/dockly/util/git.rb

.ls_files(oid) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dockly/util/git.rb', line 15

def ls_files(oid)
  target = repo.lookup(oid)
  target = target.target until target.type == :commit
  ary = []
  target.tree.walk(:postorder) do |root, entry|
    next unless entry[:type] == :blob
    name = File.join(root, entry[:name]).gsub(/\A\//, '')
    ary << entry.merge(name: name)
  end
  ary
end