diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-05 17:18:58 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-05 17:18:58 +0300 |
commit | 737f0ae8fdf3bdd23d02da8b7fbfd8e42ba78fdd (patch) | |
tree | ddb33b1b302a7c2ffd045a467628abd545689678 /lib/gitlab/shell.rb | |
parent | 0f33ac64428b06f194882e23f5167cb9791a7f0f (diff) | |
parent | dcebe1494e35fcd8870b38f311c5176eab6b2a2f (diff) |
Merge branch 'ban-disk-import' into 'master'
Don't use Gitlab::Shell#import_repository on local paths
See merge request gitlab-org/gitlab-ce!16228
Diffstat (limited to 'lib/gitlab/shell.rb')
-rw-r--r-- | lib/gitlab/shell.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index b9cc97c9244..564047bbd34 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -101,6 +101,10 @@ module Gitlab # # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/874 def import_repository(storage, name, url) + if url.start_with?('.', '/') + raise Error.new("don't use disk paths with import_repository: #{url.inspect}") + end + # The timeout ensures the subprocess won't hang forever cmd = gitlab_projects(storage, "#{name}.git") success = cmd.import_project(url, git_timeout) |