Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <novalis@novalis.org>2017-04-18 08:44:32 +0300
committerDavid Turner <novalis@novalis.org>2017-05-15 23:04:46 +0300
commit897a85a461b95ece12a1c5daaa86f55c27ddadcb (patch)
tree9f855cc73be0e1f171b18078c5a3eccab7140c5f /spec/helpers/submodule_helper_spec.rb
parentea5d43a3b8c01fb83d215a7eb15f246f26a34c64 (diff)
submodule_links: Handle in-repository submodule urls
Sometimes it is useful to store submodules in the same repository which contains links to them. Make the UI support this. See https://github.com/twosigma/git-meta/wiki/The-Omega-Repo for information about this strategy Signed-off-by: David Turner <novalis@novalis.org>
Diffstat (limited to 'spec/helpers/submodule_helper_spec.rb')
-rw-r--r--spec/helpers/submodule_helper_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb
index 9da33792659..18935be95c9 100644
--- a/spec/helpers/submodule_helper_spec.rb
+++ b/spec/helpers/submodule_helper_spec.rb
@@ -81,6 +81,19 @@ describe SubmoduleHelper do
end
end
+ context 'in-repository submodule' do
+ let(:group) { create(:group, name: "Master Project", path: "master-project") }
+ let(:project) { create(:empty_project, group: group) }
+ before do
+ self.instance_variable_set(:@project, project)
+ end
+
+ it 'in-repository' do
+ stub_url('./')
+ expect(submodule_links(submodule_item)).to eq(["/master-project/#{project.path}", "/master-project/#{project.path}/tree/hash"])
+ end
+ end
+
context 'submodule on gitlab.com' do
it 'detects ssh' do
stub_url('git@gitlab.com:gitlab-org/gitlab-ce.git')