From 3198f8a4734d601f51cad9be3912a39c88675c38 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jul 2016 11:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=89=88=E6=9C=AC=E5=BA=93?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AE=B0=E5=BD=95=E4=B8=AD=EF=BC=9A=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=E6=88=96=E8=80=85=E9=9D=9E=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E9=A2=84=E8=A7=88=E6=96=87=E4=BB=B6=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=A6=E6=83=85500=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- app/helpers/repositories_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 4764d1cd7..25d7b2a15 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -49,7 +49,7 @@ class RepositoriesController < ApplicationController helper :project_score #@root_path = RepositoriesHelper::ROOT_PATH $g=Gitlab.client - require 'net/ssh' + # require 'net/ssh' rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed def new diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index b525c4aed..72bee4843 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -65,7 +65,7 @@ module RepositoriesHelper # 获取diff内容行号 def diff_line_num content - content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i + content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i end # 处理内容