summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-07-17 14:24:39 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-07-17 14:24:39 +0000
commitf66d5c5f9f155d2e6467a186e81cee6677489d90 (patch)
tree8b367a346890392cd4fef760739c0518116cdfc4
parent71ffe5e8107197b4c7ca4b3d93be753cf80d6e90 (diff)
parent99463287618b61f76d157b572a670e9237d80a43 (diff)
downloadgitlab-ce-f66d5c5f9f155d2e6467a186e81cee6677489d90.tar.gz
Merge branch 'zj-remove-sanitize-repo-path' into 'master'
Remove sanitize_repo_path Closes gitaly#1235 See merge request gitlab-org/gitlab-ce!20666
-rw-r--r--app/helpers/projects_helper.rb14
-rw-r--r--app/views/projects/imports/new.html.haml2
-rw-r--r--spec/helpers/projects_helper_spec.rb27
3 files changed, 1 insertions, 42 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index b0f381db5ab..221f1aa9dd8 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -413,20 +413,6 @@ module ProjectsHelper
@ref || @repository.try(:root_ref)
end
- # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1235
- def sanitize_repo_path(project, message)
- return '' unless message.present?
-
- exports_path = File.join(Settings.shared['path'], 'tmp/project_exports')
- filtered_message = message.strip.gsub(exports_path, "[REPO EXPORT PATH]")
-
- disk_path = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
- Gitlab.config.repositories.storages[project.repository_storage].legacy_disk_path
- end
-
- filtered_message.gsub(disk_path.chomp('/'), "[REPOS PATH]")
- end
-
def project_child_container_class(view_path)
view_path == "projects/issues/issues" ? "prepend-top-default" : "project-show-#{view_path}"
end
diff --git a/app/views/projects/imports/new.html.haml b/app/views/projects/imports/new.html.haml
index 16c4f21279d..ca82054d799 100644
--- a/app/views/projects/imports/new.html.haml
+++ b/app/views/projects/imports/new.html.haml
@@ -10,7 +10,7 @@
.card-body
%pre
:preserve
- #{h(sanitize_repo_path(@project, @project.import_error))}
+ #{h(@project.import_error)}
= form_for @project, url: project_import_path(@project), method: :post do |f|
= render "shared/import_form", f: f
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index beb6e8ea273..cbd4ff0fb4a 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -290,33 +290,6 @@ describe ProjectsHelper do
end
end
- describe '#sanitizerepo_repo_path' do
- let(:project) { create(:project, :repository) }
- let(:storage_path) do
- Gitlab::GitalyClient::StorageSettings.allow_disk_access do
- Gitlab.config.repositories.storages.default.legacy_disk_path
- end
- end
-
- before do
- allow(Settings.shared).to receive(:[]).with('path').and_return('/base/repo/export/path')
- end
-
- it 'removes the repo path' do
- repo = File.join(storage_path, 'namespace/test.git')
- import_error = "Could not clone #{repo}\n"
-
- expect(sanitize_repo_path(project, import_error)).to eq('Could not clone [REPOS PATH]/namespace/test.git')
- end
-
- it 'removes the temporary repo path used for uploads/exports' do
- repo = '/base/repo/export/path/tmp/project_exports/uploads/test.tar.gz'
- import_error = "Unable to decompress #{repo}\n"
-
- expect(sanitize_repo_path(project, import_error)).to eq('Unable to decompress [REPO EXPORT PATH]/uploads/test.tar.gz')
- end
- end
-
describe '#last_push_event' do
let(:user) { double(:user, fork_of: nil) }
let(:project) { double(:project, id: 1) }