summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-13 15:23:34 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-13 15:23:34 +0200
commite4a9b0771abdcd4e478cfc763ca7fcecc99ae505 (patch)
tree5ce244b20532de3d1f11fcd9672304862ef45cb9 /lib/gitlab
parent7fc47faeb6dc5d92a69ddb8c22a8b2fd4dda2247 (diff)
downloadgitlab-ce-e4a9b0771abdcd4e478cfc763ca7fcecc99ae505.tar.gz
ListCommitByOid isn't called with an empty batch
Batching commits for performance improvements, might lead to empty batches being used. This isn't the case yet, but to guard against this in future cases, a guard clause is added.
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/gitaly_client/commit_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb
index a4cc64de80d..7f2e6441f16 100644
--- a/lib/gitlab/gitaly_client/commit_service.rb
+++ b/lib/gitlab/gitaly_client/commit_service.rb
@@ -179,6 +179,8 @@ module Gitlab
end
def list_commits_by_oid(oids)
+ return [] if oids.empty?
+
request = Gitaly::ListCommitsByOidRequest.new(repository: @gitaly_repo, oid: oids)
response = GitalyClient.call(@repository.storage, :commit_service, :list_commits_by_oid, request, timeout: GitalyClient.medium_timeout)