Skip to content

Commit 221ab65

Browse files
author
root
committed
Merge branch 'devel' into feat_protected_branches
Conflicts: lib/redmine_git_hosting/patches/repository_git_patch.rb
2 parents 5d88df2 + 00591c7 commit 221ab65

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

Diff for: app/controllers/gitolite_public_keys_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def suggested_title
123123
default_title = "#{@project.name} Deploy Key"
124124

125125
# Find number of keys or max default deploy key that matches
126-
maxnum = @repository.repository_deployment_credentials.map(&:gitolite_public_key).uniq.count
127-
@repository.repository_deployment_credentials.each do |credential|
126+
maxnum = @repository.deployment_credentials.map(&:gitolite_public_key).uniq.count
127+
@repository.deployment_credentials.each do |credential|
128128
if matches = credential.gitolite_public_key.title.match(/#{default_title} (\d+)$/)
129129
maxnum = [maxnum, matches[1].to_i].max
130130
end

Diff for: app/controllers/repository_deployment_credentials_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def find_key
142142
def find_all_keys
143143
# display create_with_key view. Find preexisting keys to offer to user
144144
@user_keys = GitolitePublicKey.by_user(User.current).deploy_key.active.order('title ASC')
145-
@disabled_keys = @repository.repository_deployment_credentials.active.map(&:gitolite_public_key)
145+
@disabled_keys = @repository.deployment_credentials.active.map(&:gitolite_public_key)
146146

147147
@other_keys = []
148148
if User.current.admin?

Diff for: app/helpers/git_hosting_helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ def render_feature(repository, feature)
9999
when :repository_deployment_credentials
100100
label = l(:label_deployment_credentials)
101101
css_class << ' icon-deployment-credentials'
102-
enabled = repository.repository_deployment_credentials.active.any?
102+
enabled = repository.deployment_credentials.active.any?
103103

104104
when :repository_post_receive_urls
105105
label = l(:label_post_receive_urls)
106106
css_class << ' icon-post-receive-urls'
107-
enabled = repository.repository_post_receive_urls.active.any?
107+
enabled = repository.post_receive_urls.active.any?
108108

109109
when :repository_mirrors
110110
label = l(:label_repository_mirrors)
111111
css_class << ' icon-mirrors'
112-
enabled = repository.repository_mirrors.active.any?
112+
enabled = repository.mirrors.active.any?
113113

114114
when :git_daemon
115115
label = l(:label_git_daemon)

Diff for: app/services/hooks/git_mirrors.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def call_mirrors
2727
y = ""
2828

2929
## Push to each mirror
30-
if @repository.repository_mirrors.active.any?
30+
if @repository.mirrors.active.any?
3131

3232
logger.info { "Notifying mirrors about changes to this repository :" }
3333
y << "\nNotifying mirrors about changes to this repository :\n"
3434

35-
@repository.repository_mirrors.active.each do |mirror|
35+
@repository.mirrors.active.each do |mirror|
3636
if mirror.needs_push(@payload)
3737
logger.info { "Pushing changes to #{mirror.url} ... " }
3838
y << " - Pushing changes to #{mirror.url} ... "

Diff for: app/services/hooks/webservices.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def call_webservices
2929
y = ""
3030

3131
## Post to each post-receive URL
32-
if @repository.repository_post_receive_urls.active.any?
32+
if @repository.post_receive_urls.active.any?
3333

3434
logger.info { "Notifying post receive urls about changes to this repository :" }
3535
y << "\nNotifying post receive urls about changes to this repository :\n"
3636

37-
@repository.repository_post_receive_urls.active.each do |post_receive_url|
37+
@repository.post_receive_urls.active.each do |post_receive_url|
3838
if payloads = post_receive_url.needs_push(@payload)
3939

4040
method = (post_receive_url.mode == :github) ? :post : :get

Diff for: lib/redmine_git_hosting/patches/repository_git_patch.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ def self.included(base)
1111
has_one :git_extra, :foreign_key => 'repository_id', :class_name => 'RepositoryGitExtra', :dependent => :destroy
1212
has_one :git_notification, :foreign_key => 'repository_id', :class_name => 'RepositoryGitNotification', :dependent => :destroy
1313

14-
has_many :repository_mirrors, :dependent => :destroy, :foreign_key => 'repository_id'
15-
has_many :repository_post_receive_urls, :dependent => :destroy, :foreign_key => 'repository_id'
16-
has_many :repository_deployment_credentials, :dependent => :destroy, :foreign_key => 'repository_id'
17-
has_many :repository_git_config_keys, :dependent => :destroy, :foreign_key => 'repository_id'
18-
has_many :repository_protected_branches, :dependent => :destroy, :foreign_key => 'repository_id'
14+
has_many :mirrors, :dependent => :destroy, :foreign_key => 'repository_id', :class_name => 'RepositoryMirror'
15+
has_many :post_receive_urls, :dependent => :destroy, :foreign_key => 'repository_id', :class_name => 'RepositoryPostReceiveUrl'
16+
has_many :deployment_credentials, :dependent => :destroy, :foreign_key => 'repository_id', :class_name => 'RepositoryDeploymentCredential'
17+
has_many :git_config_keys, :dependent => :destroy, :foreign_key => 'repository_id', :class_name => 'RepositoryGitConfigKey'
18+
has_many :protected_branches, :dependent => :destroy, :foreign_key => 'repository_id', :class_name => 'RepositoryProtectedBranche'
1919

2020
alias_method_chain :report_last_commit, :git_hosting
2121
alias_method_chain :extra_report_last_commit, :git_hosting

Diff for: lib/redmine_gitolite/gitolite_wrapper/repositories_helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def do_update_repository(repository, old_permissions)
112112
end
113113

114114
# Set Git config keys
115-
if repository.repository_git_config_keys.any?
116-
repository.repository_git_config_keys.each do |git_config_key|
115+
if repository.git_config_keys.any?
116+
repository.git_config_keys.each do |git_config_key|
117117
repo_conf.set_git_config(git_config_key.key, git_config_key.value)
118118
end
119119
end
@@ -228,7 +228,7 @@ def build_permissions(repository)
228228
read = read_users.map{|user| user.gitolite_identifier}
229229

230230
## DEPLOY KEY
231-
repository.repository_deployment_credentials.active.each do |cred|
231+
repository.deployment_credentials.active.each do |cred|
232232
if cred.perm == "RW+"
233233
rewind << cred.gitolite_public_key.owner
234234
elsif cred.perm == "R"

0 commit comments

Comments
 (0)