diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-11-07 04:46:22 +0300 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-12-05 07:22:43 +0300 |
commit | 21014c59f883bf8ad11e89725834f20861abca93 (patch) | |
tree | 4a45a00cc62b47f78c04163a6f43366c2a4813c4 | |
parent | 1beb7ffc547d9be0f35dc02f15eaf9fe0bbd34e7 (diff) |
Add Project#lfs_http_url_to_repo from EE
For CE, #lfs_http_url_to_repo calls #http_url_to_repo where as for EE we
examine for a Geo setup so we can support push to secondary for LFS.
-rw-r--r-- | app/models/project.rb | 5 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 1c5c34111b0..6ec323b58c2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1140,6 +1140,11 @@ class Project < ActiveRecord::Base "#{web_url}.git" end + # Is overriden in EE + def lfs_http_url_to_repo(_) + http_url_to_repo + end + def forked? fork_network && fork_network.root_project != self end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 3f99fd12e38..54ad3c858d5 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2710,6 +2710,17 @@ describe Project do end end + describe '#lfs_http_url_to_repo' do + let(:project) { create(:project) } + + it 'returns the url to the repo without a username' do + lfs_http_url_to_repo = project.lfs_http_url_to_repo('operation_that_doesnt_matter') + + expect(lfs_http_url_to_repo).to eq("#{project.web_url}.git") + expect(lfs_http_url_to_repo).not_to include('@') + end + end + describe '#pipeline_status' do let(:project) { create(:project, :repository) } it 'builds a pipeline status' do |