refactor code: repository.rb

This commit is contained in:
Dmitriy Zaporozhets 2011-11-11 00:51:19 +02:00
parent 99bd00158c
commit dab072c1ab
4 changed files with 82 additions and 56 deletions

View file

@ -64,7 +64,7 @@ class ApplicationController < ActionController::Base
else
@branch = params[:branch].blank? ? nil : params[:branch]
@tag = params[:tag].blank? ? nil : params[:tag]
@ref = @branch || @tag || "master"
@ref = @branch || @tag || Repository.default_ref
end
end

View file

@ -108,7 +108,7 @@ class ProjectsController < ApplicationController
if params[:commit_id]
@commit = @repo.commits(params[:commit_id]).first
else
@commit = @repo.commits(@ref || "master").first
@commit = @repo.commits(@ref).first
end
@tree = @commit.tree