Class: Bulb::TreeController

Inherits:
BulbController show all
Defined in:
app/controllers/bulb/tree_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
# File 'app/controllers/bulb/tree_controller.rb', line 6

def show
  @git_repository = @repository.git_repository
  tree_hash = @git_repository.head.target.tree.path(params[:path])

  redirect_to repository_blob_path if tree_hash[:type] == :blob

  @tree = @git_repository.lookup(tree_hash[:oid])
end