From 555a9131c4aedf93fc20d00322036b50cf225246 Mon Sep 17 00:00:00 2001 From: newuser Date: Fri, 26 Feb 2016 15:37:59 +0800 Subject: [PATCH] =?UTF-8?q?Gitlab=E7=AB=AF=E8=8E=B7=E5=8F=96=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 7655f1eb4..f7845d6f1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -633,9 +633,10 @@ update end (render_404; return false) unless @repository @path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s - @rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip + # gitlab端获取默认分支 + gitlab_branchs = $g.project(@project.gpid).default_branch + @project.gpid.nil? ? (@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip) : (@rev = params[:rev].blank? ? gitlab_branchs : params[:rev].to_s.strip) @rev_to = params[:rev_to] - unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE) if @repository.branches.blank? raise InvalidRevisionParam