Skip to content

Commit 9638a46

Browse files
author
Nicolas Rodriguez
committed
Fix potential bugs when moving repositories
1 parent c9e4838 commit 9638a46

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: lib/redmine_git_hosting/gitolite_handlers/repository_mover.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(repository, gitolite_config, action)
1717
def call
1818
if !repo_conf
1919
logger.error("#{action} : repository '#{old_repo_name}' does not exist in Gitolite, exit !")
20-
return
20+
nil
2121
else
2222
perform_repository_move
2323
end
@@ -41,6 +41,8 @@ def perform_repository_move
4141

4242
# Return old path to delete it
4343
old_relative_parent_path
44+
else
45+
nil
4446
end
4547
end
4648

Diff for: lib/redmine_git_hosting/gitolite_wrapper/projects.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def handle_repositories_move(git_projects)
8181
delete_parent_path = []
8282
git_projects.reverse.each do |project|
8383
project.gitolite_repos.reverse.each do |repository|
84-
repo_list.push << repository.gitolite_repository_name
84+
repo_list << repository.gitolite_repository_name
8585
delete_parent_path << RedmineGitHosting::GitoliteHandlers::RepositoryMover.new(repository, gitolite_config, action).call
8686
end
8787
gitolite_admin_repo_commit("#{action} : #{project.identifier} | #{repo_list}")

0 commit comments

Comments
 (0)