Añade plugin Redmine Git Hosting 4.0.2
This commit is contained in:
parent
472cb1ea76
commit
bdd66d941f
494 changed files with 36768 additions and 0 deletions
29
plugins/redmine_git_hosting/app/use_cases/projects/update.rb
Normal file
29
plugins/redmine_git_hosting/app/use_cases/projects/update.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Projects
|
||||
class Update < Base
|
||||
|
||||
def call
|
||||
# Adjust daemon status
|
||||
disable_git_daemon_if_not_public
|
||||
resync
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
|
||||
def disable_git_daemon_if_not_public
|
||||
# Go through all gitolite repos and disable Git daemon if necessary
|
||||
project.gitolite_repos.each do |repository|
|
||||
repository.extra[:git_daemon] = false if repository.git_daemon_enabled? && !project.is_public
|
||||
# Save GitExtra in all cases to trigger urls order consistency checks
|
||||
repository.extra.save
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def resync
|
||||
gitolite_accessor.update_projects([project.id], options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue