Extend models functionality with old decorator methods. Use Repository model

This commit is contained in:
Dmitriy Zaporozhets 2013-03-31 23:48:12 +03:00
parent b53557aca6
commit bbfbff3add
7 changed files with 67 additions and 11 deletions

View file

@ -101,10 +101,8 @@ module ExtractsPath
# It is used "@project.repository.commits(@ref, @path, 1, 0)",
# because "@project.repository.commit(@ref)" returns wrong commit when @ref is tag name.
@commit = @project.repository.commits(@ref, @path, 1, 0).first
@commit = CommitDecorator.decorate(@commit)
@tree = Tree.new(@commit.tree, @ref, @path)
@tree = TreeDecorator.new(@tree)
raise InvalidPathError if @tree.invalid?
rescue RuntimeError, NoMethodError, InvalidPathError