Method: Gitgo::Controllers::Code#show_tree

Defined in:
lib/gitgo/controllers/code.rb

#show_tree(treeish, path) ⇒ Object



136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/gitgo/controllers/code.rb', line 136

def show_tree(treeish, path)
  commit = grit.commit(treeish) || not_found
  tree = path.split("/").inject(commit.tree) do |obj, name|
    not_found if obj.nil?
    obj.trees.find {|obj| obj.name == name }
  end

  erb :tree, :locals => {
    :commit => commit, 
    :treeish => treeish, 
    :tree => tree, 
    :path => path
  }
end