summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-10-20 10:27:48 +0000
committerNick Thomas <nick@gitlab.com>2017-10-20 10:27:48 +0000
commitbc734d34479dfe80984b851153447ce03d4c93a0 (patch)
treeda18a7a238ba3b8ffdb2672d9a5f446472556429
parentb4dc0ba2c57c150f847d255b0d2d831ff60728ad (diff)
parent314e5b5f20889971fef092c26bcb675ac2af4b07 (diff)
downloadgitlab-ce-bc734d34479dfe80984b851153447ce03d4c93a0.tar.gz
Merge branch '37391-wiki-disk-path-helper' into 'master'
Use wiki.disk_path See merge request gitlab-org/gitlab-ce!14930
-rw-r--r--app/services/projects/destroy_service.rb2
-rw-r--r--lib/github/import.rb2
-rw-r--r--lib/gitlab/github_import/wiki_formatter.rb2
-rw-r--r--spec/lib/gitlab/github_import/wiki_formatter_spec.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb
index 19d75ff2efa..81972df9b3c 100644
--- a/app/services/projects/destroy_service.rb
+++ b/app/services/projects/destroy_service.rb
@@ -51,7 +51,7 @@ module Projects
end
def wiki_path
- repo_path + '.wiki'
+ project.wiki.disk_path
end
def trash_repositories!
diff --git a/lib/github/import.rb b/lib/github/import.rb
index 55f8387f27a..76612799412 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -74,7 +74,7 @@ module Github
def fetch_wiki_repository
return if project.wiki.repository_exists?
- wiki_path = "#{project.disk_path}.wiki"
+ wiki_path = project.wiki.disk_path
gitlab_shell.import_repository(project.repository_storage_path, wiki_path, wiki_url)
rescue Gitlab::Shell::Error => e
# GitHub error message when the wiki repo has not been created,
diff --git a/lib/gitlab/github_import/wiki_formatter.rb b/lib/gitlab/github_import/wiki_formatter.rb
index 0396122eeb9..ca8d96f5650 100644
--- a/lib/gitlab/github_import/wiki_formatter.rb
+++ b/lib/gitlab/github_import/wiki_formatter.rb
@@ -8,7 +8,7 @@ module Gitlab
end
def disk_path
- "#{project.disk_path}.wiki"
+ project.wiki.disk_path
end
def import_url
diff --git a/spec/lib/gitlab/github_import/wiki_formatter_spec.rb b/spec/lib/gitlab/github_import/wiki_formatter_spec.rb
index fcd90fab547..2662cc20b32 100644
--- a/spec/lib/gitlab/github_import/wiki_formatter_spec.rb
+++ b/spec/lib/gitlab/github_import/wiki_formatter_spec.rb
@@ -11,7 +11,7 @@ describe Gitlab::GithubImport::WikiFormatter do
describe '#disk_path' do
it 'appends .wiki to project path' do
- expect(wiki.disk_path).to eq project.disk_path + '.wiki'
+ expect(wiki.disk_path).to eq project.wiki.disk_path
end
end