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
path: root/spec/lib
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2019-04-05 13:51:42 +0300
committerDouwe Maan <douwe@gitlab.com>2019-04-05 13:51:42 +0300
commit2fdda74458bb7b58a6a18b72170a572f72afdd95 (patch)
tree1d593dc1d7ac185ba1d6977865f79d0871b1f846 /spec/lib
parent934dabaf6da42db7197e07dc95cf88d34e847306 (diff)
Fall back to project repository type by default
This makes sure that we always have a repository type when trying to parse a repository from a path. This is needed because sometimes we want to perform access checks as if the project already existed, for example when creating a project on push. Before this we were only doing that when accessing git over http, this makes sure it also works correctly when accessing git over SSH
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/repo_path_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/lib/gitlab/repo_path_spec.rb b/spec/lib/gitlab/repo_path_spec.rb
index 4c7ca4e2b57..8fbda929064 100644
--- a/spec/lib/gitlab/repo_path_spec.rb
+++ b/spec/lib/gitlab/repo_path_spec.rb
@@ -44,8 +44,10 @@ describe ::Gitlab::RepoPath do
end
end
- it "returns nil for non existent paths" do
- expect(described_class.parse("path/non-existent.git")).to eq(nil)
+ it "returns the default type for non existent paths" do
+ _project, type, _redirected = described_class.parse("path/non-existent.git")
+
+ expect(type).to eq(Gitlab::GlRepository.default_type)
end
end