Don't modify original config object

Use `Marshal` to avoid mutating the original copy of the storage config.
This commit is contained in:
Will Chandler 2024-05-01 12:44:49 -04:00
parent e29a335bd2
commit 53a378fb7f
1 changed files with 2 additions and 1 deletions

View File

@ -163,7 +163,8 @@ module Gitaly
# Validate that no storages are sharing the same path.
def check_duplicate_storage_paths
storages = Gitlab['gitaly']['configuration']['storage'].dup
# Deep copy storages to avoid mutating the original.
storages = Marshal.load(Marshal.dump(Gitlab['gitaly']['configuration']['storage']))
storages.each do |storage|
storage[:realpath] =