Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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