Skip to content

Commit

Permalink
Merge pull request #1 from evolvingweb/redmine-5-compatibility
Browse files Browse the repository at this point in the history
Redmine 5 compatibility
  • Loading branch information
burak-ikiler-ew authored May 30, 2024
2 parents b045626 + 718e8bc commit 984a88b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/models/repository/git_remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
require 'pathname'
require 'fileutils'
# require 'open3'
require_dependency 'redmine_git_remote/poor_mans_capture3'
Rails.configuration.to_prepare do
require_dependency 'redmine_git_remote/poor_mans_capture3'
end

class Repository::GitRemote < Repository::Git

Expand Down Expand Up @@ -100,7 +102,7 @@ def ensure_possibly_empty_clone_exists
return "#{clone_url} is not a valid remote."
end

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

Expand Down
6 changes: 4 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
require 'redmine'
require_dependency "redmine_git_remote/repositories_helper_patch"

Rails.configuration.to_prepare do
require_dependency "redmine_git_remote/repositories_helper_patch"
end
Redmine::Scm::Base.add "GitRemote"

Redmine::Plugin.register :redmine_git_remote do
name 'Redmine Git Remote'
author 'Alex Dergachev'
url 'https://github.com/dergachev/redmine_git_remote'
description 'Automatically clone and fetch remote git repositories'
version '0.0.2'
version '0.0.3'

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

0 comments on commit 984a88b

Please sign in to comment.