summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-04-17 16:30:16 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-04-17 16:30:18 +0200
commite02f1271f5784fe7c17a9efae8612999e1e62ee3 (patch)
tree168b4a215a51cb980c8e6c34da51a052f75f6a7c /spec/models
parent25cb70ba6087d86343a127df88394fbe97b381b1 (diff)
downloadgitlab-ce-e02f1271f5784fe7c17a9efae8612999e1e62ee3.tar.gz
Return nil on empty path
The execution path wasn't clear from the error, but either way this is a fix. Closes gitlab-org/gitaly#1115
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/commit_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 959383ff0b7..4e6b037a720 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -450,6 +450,11 @@ eos
it "returns nil if the path doesn't exists" do
expect(commit.uri_type('this/path/doesnt/exist')).to be_nil
end
+
+ it 'is nil if the path is nil or empty' do
+ expect(commit.uri_type(nil)).to be_nil
+ expect(commit.uri_type("")).to be_nil
+ end
end
context 'when Gitaly commit_tree_entry feature is enabled' do