diff options
author | Rémy Coutable <remy@rymai.me> | 2018-01-25 17:52:01 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-01-25 17:52:01 +0000 |
commit | 26c4dea7ad37f5680ada812e212274ebd8473a78 (patch) | |
tree | e94cbb24402a46947996ae1783995d9f11ae5524 /lib/gitlab/gitaly_client | |
parent | e4c2ce6f67ffdaa88ee394c93e07f175f6e309eb (diff) | |
parent | 6d6f7536bd9b5bcbf94dfbe15cc86e84d06527f5 (diff) | |
download | gitlab-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.rb | 20 |
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) |