diff options
Diffstat (limited to 'lib/gitlab/shell.rb')
-rw-r--r-- | lib/gitlab/shell.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index d26e1a34a9f..b167afe589a 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -70,7 +70,9 @@ module Gitlab link_path = File.join(shell_path, '.gitlab_shell_secret') if File.exist?(shell_path) && !File.exist?(link_path) - FileUtils.symlink(secret_file, link_path) + # It could happen that link_path is a broken symbolic link. + # In that case !File.exist?(link_path) is true, but we still want to overwrite the (broken) symbolic link. + FileUtils.ln_sf(secret_file, link_path) end end end |