Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-15 00:07:39 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-15 00:07:39 +0300
commit889c275fb7531e66d696c12eb3bc737c6654eed0 (patch)
tree96be665533a78702a4fa0bf54b8f47e7d37a4b30 /lib/gitlab/gitaly_client
parent283c7bb302510ed1fc55f0d333c484ce7fa781fd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r--lib/gitlab/gitaly_client/commit_service.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb
index e5f8a255f7d..4df9d800ea6 100644
--- a/lib/gitlab/gitaly_client/commit_service.rb
+++ b/lib/gitlab/gitaly_client/commit_service.rb
@@ -6,6 +6,12 @@ module Gitlab
include Gitlab::EncodingHelper
include WithFeatureFlagActors
+ WHITESPACE_CHANGES = {
+ 'ignore_all_spaces' => Gitaly::CommitDiffRequest::WhitespaceChanges::WHITESPACE_CHANGES_IGNORE_ALL,
+ 'ignore_spaces' => Gitaly::CommitDiffRequest::WhitespaceChanges::WHITESPACE_CHANGES_IGNORE,
+ 'unspecified' => Gitaly::CommitDiffRequest::WhitespaceChanges::WHITESPACE_CHANGES_UNSPECIFIED
+ }.freeze
+
TREE_ENTRIES_DEFAULT_LIMIT = 100_000
def initialize(repository)
@@ -538,6 +544,11 @@ module Gitlab
def call_commit_diff(request_params, options = {})
request_params[:ignore_whitespace_change] = options.fetch(:ignore_whitespace_change, false)
+
+ if Feature.enabled?(:add_ignore_all_white_spaces) && (request_params[:ignore_whitespace_change])
+ request_params[:whitespace_changes] = WHITESPACE_CHANGES['ignore_all_spaces']
+ end
+
request_params[:enforce_limits] = options.fetch(:limits, true)
request_params[:collapse_diffs] = !options.fetch(:expanded, true)
request_params.merge!(Gitlab::Git::DiffCollection.limits(options))