From 9cfb2c2a19cd545f53e2587d51db24f2cde38b16 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 19 Jul 2019 23:36:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E8=BF=81=E7=A7=BB=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index ecbf603b0..5c432baa0 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -489,7 +489,13 @@ class GamesController < ApplicationController path = path.try(:strip) uid_logger("--rep_content: path is #{path}") begin - @content = git_fle_content(@myshixun.repo_path, path) || "" + if @myshixun.repo_name.nil? + g = Gitlab.client + repo_name = g.project(@myshixun.gpid).path_with_namespace + @myshixun.update_column(:repo_name, repo_name) + end + + @content = git_fle_content("#{repo_name}.git", path) || "" rescue Exception => e # 思路: 异常首先应该考虑去恢复 if params[:retry].to_i == 1