summaryrefslogtreecommitdiff
path: root/lib/gitlab/gitaly_client
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-01-25 17:52:01 +0000
committerRémy Coutable <remy@rymai.me>2018-01-25 17:52:01 +0000
commit26c4dea7ad37f5680ada812e212274ebd8473a78 (patch)
treee94cbb24402a46947996ae1783995d9f11ae5524 /lib/gitlab/gitaly_client
parente4c2ce6f67ffdaa88ee394c93e07f175f6e309eb (diff)
parent6d6f7536bd9b5bcbf94dfbe15cc86e84d06527f5 (diff)
downloadgitlab-ce-26c4dea7ad37f5680ada812e212274ebd8473a78.tar.gz
Merge branch 'lint-rugged' into 'master'
Add a lint check to restrict use of Rugged See merge request gitlab-org/gitlab-ce!16656
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r--lib/gitlab/gitaly_client/commit_service.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb
index 33a8d3e5612..cadc7149301 100644
--- a/lib/gitlab/gitaly_client/commit_service.rb
+++ b/lib/gitlab/gitaly_client/commit_service.rb
@@ -38,19 +38,27 @@ module Gitlab
from_id = case from
when NilClass
EMPTY_TREE_ID
- when Rugged::Commit
- from.oid
else
- from
+ if from.respond_to?(:oid)
+ # This is meant to match a Rugged::Commit. This should be impossible in
+ # the future.
+ from.oid
+ else
+ from
+ end
end
to_id = case to
when NilClass
EMPTY_TREE_ID
- when Rugged::Commit
- to.oid
else
- to
+ if to.respond_to?(:oid)
+ # This is meant to match a Rugged::Commit. This should be impossible in
+ # the future.
+ to.oid
+ else
+ to
+ end
end
request_params = diff_between_commits_request_params(from_id, to_id, options)