解决版本库提交记录中:上传图片或者非可以预览文件 显示详情500问题

This commit is contained in:
huang 2016-07-18 11:17:22 +08:00
parent 4c5052dce2
commit 3198f8a473
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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
# 处理内容