diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-04-12 06:05:07 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-04-12 06:05:07 +0300 |
commit | d28b1dfc46d9f95c516c19aa9a2d166be554eca2 (patch) | |
tree | 9d3b50cc026d4bf8f8c4b8acc63f075269ce9ab7 /lib/gitlab/gitaly_client | |
parent | dd552d06f6e39d5e6138a33bd7c1bffb2d3dbb1d (diff) |
Backport of EE !4989
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r-- | lib/gitlab/gitaly_client/commit_service.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb index 456a8a1a2d6..a36e6c822f9 100644 --- a/lib/gitlab/gitaly_client/commit_service.rb +++ b/lib/gitlab/gitaly_client/commit_service.rb @@ -3,10 +3,6 @@ module Gitlab class CommitService include Gitlab::EncodingHelper - # The ID of empty tree. - # See http://stackoverflow.com/a/40884093/1856239 and https://github.com/git/git/blob/3ad8b5bf26362ac67c9020bf8c30eee54a84f56d/cache.h#L1011-L1012 - EMPTY_TREE_ID = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'.freeze - def initialize(repository) @gitaly_repo = repository.gitaly_repository @repository = repository @@ -37,7 +33,7 @@ module Gitlab def diff(from, to, options = {}) from_id = case from when NilClass - EMPTY_TREE_ID + Gitlab::Git::EMPTY_TREE_ID else if from.respond_to?(:oid) # This is meant to match a Rugged::Commit. This should be impossible in @@ -50,7 +46,7 @@ module Gitlab to_id = case to when NilClass - EMPTY_TREE_ID + Gitlab::Git::EMPTY_TREE_ID else if to.respond_to?(:oid) # This is meant to match a Rugged::Commit. This should be impossible in @@ -352,7 +348,7 @@ module Gitlab end def diff_from_parent_request_params(commit, options = {}) - parent_id = commit.parent_ids.first || EMPTY_TREE_ID + parent_id = commit.parent_ids.first || Gitlab::Git::EMPTY_TREE_ID diff_between_commits_request_params(parent_id, commit.id, options) end |