Permalink
Browse files

Merge branch 'master' of github.com:ericpaulbishop/redmine_git_hosting

  • Loading branch information...
2 parents 1429de7 + 31ebd3d commit e1923bb5af278dc0fb7ab245a58a007178c575db @ericpaulbishop committed Jun 28, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/git_hosting/patches/projects_controller_patch.rb
View
14 lib/git_hosting/patches/projects_controller_patch.rb
@@ -23,12 +23,26 @@ def git_repo_init
end
+ def disable_git_daemon_if_not_public
+ if @project.repository != nil
+ if @project.repository != nil
+ if @project.repository.is_a?(Repository::Git)
+ if @project.repository.git_daemon == 1 && (not @project.is_public )
+ @project.repository.git_daemon = 0;
+ @project.repository.save
+ end
+ end
+ end
+ end
+ end
+
def self.included(base)
base.class_eval do
unloadable
end
base.send(:after_filter, :git_repo_init, :only=>:create)
+ base.send(:after_filter, :disable_git_daemon_if_not_public, :only=>:update)
end
end
end

0 comments on commit e1923bb

Please sign in to comment.