Skip to content
Snippets Groups Projects
Commit b2d300f3 authored by Rémy Coutable's avatar Rémy Coutable Committed by John Jarvis
Browse files

Merge branch 'sh-fix-blank-codeowners-ce' into 'master'

Fix 500 error caused by CODEOWNERS with no matches

Closes gitlab-ee#10282

See merge request gitlab-org/gitlab-ce!26072
parent d5fa495b
No related branches found
No related tags found
No related merge requests found
---
title: Fix 500 error caused by CODEOWNERS with no matches
merge_request: 26072
author:
type: fixed
Loading
Loading
@@ -16,6 +16,7 @@ module Gitlab
 
def users
return User.none unless @text.present?
return User.none if references.empty?
 
@users ||= User.from_union(union_relations)
end
Loading
Loading
Loading
Loading
@@ -48,6 +48,14 @@ describe Gitlab::UserExtractor do
it 'includes all mentioned usernames' do
expect(extractor.matches[:usernames]).to contain_exactly('user-1', 'user-2', 'user-4')
end
context 'input has no matching e-mail or usernames' do
it 'returns an empty list of users' do
extractor = described_class.new('My test')
expect(extractor.users).to be_empty
end
end
end
 
describe '#references' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment