diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-11-07 12:46:22 +1100 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-12-03 17:45:19 +1100 |
commit | ec32f9b65e9cbc85502e1c58abad290ac7c67228 (patch) | |
tree | 955a3d83f0914eaf8fc61f99f38bc9c07e1ff426 | |
parent | 7b481f3aeb8be47d8e49b860b067afcaeed3b467 (diff) | |
download | gitlab-ce-ashmckenzie/8114-geo-push-ssh-lfs-http-auth-bug.tar.gz |
Add Project#lfs_http_url_to_repo from EEashmckenzie/8114-geo-push-ssh-lfs-http-auth-bug
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 ade20cc8948..bd7b0123e42 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 af5b0939ca2..23f71abc3db 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2708,6 +2708,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 |