Skip to content

Commit 984a88b

Browse files
Merge pull request #1 from evolvingweb/redmine-5-compatibility
Redmine 5 compatibility
2 parents b045626 + 718e8bc commit 984a88b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/models/repository/git_remote.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
require 'pathname'
33
require 'fileutils'
44
# require 'open3'
5-
require_dependency 'redmine_git_remote/poor_mans_capture3'
5+
Rails.configuration.to_prepare do
6+
require_dependency 'redmine_git_remote/poor_mans_capture3'
7+
end
68

79
class Repository::GitRemote < Repository::Git
810

@@ -100,7 +102,7 @@ def ensure_possibly_empty_clone_exists
100102
return "#{clone_url} is not a valid remote."
101103
end
102104

103-
if Dir.exists? clone_path
105+
if Dir.exist? clone_path
104106
existing_repo_remote, status = RedmineGitRemote::PoorMansCapture3::capture2("git", "--git-dir", clone_path, "config", "--get", "remote.origin.url")
105107
return "Unable to run: git --git-dir #{clone_path} config --get remote.origin.url" unless status.success?
106108

init.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
require 'redmine'
2-
require_dependency "redmine_git_remote/repositories_helper_patch"
32

3+
Rails.configuration.to_prepare do
4+
require_dependency "redmine_git_remote/repositories_helper_patch"
5+
end
46
Redmine::Scm::Base.add "GitRemote"
57

68
Redmine::Plugin.register :redmine_git_remote do
79
name 'Redmine Git Remote'
810
author 'Alex Dergachev'
911
url 'https://github.com/dergachev/redmine_git_remote'
1012
description 'Automatically clone and fetch remote git repositories'
11-
version '0.0.2'
13+
version '0.0.3'
1214

1315
settings :default => {
1416
'git_remote_repo_clone_path' => Pathname.new(__FILE__).join("../").realpath.to_s + "/repos",

0 commit comments

Comments
 (0)