From e02f1271f5784fe7c17a9efae8612999e1e62ee3 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Tue, 17 Apr 2018 16:30:16 +0200 Subject: 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 --- spec/models/commit_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec/models/commit_spec.rb') 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 -- cgit v1.2.1