refactor code: repository.rb
This commit is contained in:
parent
99bd00158c
commit
dab072c1ab
4 changed files with 82 additions and 56 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue