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>2022-05-19 10:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
commit36a59d088eca61b834191dacea009677a96c052f (patch)
treee4f33972dab5d8ef79e3944a9f403035fceea43f /lib/gitlab/git
parenta1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/branch.rb4
-rw-r--r--lib/gitlab/git/diff.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/git/branch.rb b/lib/gitlab/git/branch.rb
index fbe52db9c0b..9637f8756b1 100644
--- a/lib/gitlab/git/branch.rb
+++ b/lib/gitlab/git/branch.rb
@@ -13,10 +13,6 @@ module Gitlab
end
end
- def initialize(repository, name, target, target_commit)
- super(repository, name, target, target_commit)
- end
-
def active?
self.dereferenced_target.committed_date >= STALE_BRANCH_THRESHOLD.ago
end
diff --git a/lib/gitlab/git/diff.rb b/lib/gitlab/git/diff.rb
index a66517b4ca0..c473fe6973d 100644
--- a/lib/gitlab/git/diff.rb
+++ b/lib/gitlab/git/diff.rb
@@ -230,12 +230,16 @@ module Gitlab
private
def encode_diff_to_utf8(replace_invalid_utf8_chars)
- return unless Feature.enabled?(:convert_diff_to_utf8_with_replacement_symbol, default_enabled: :yaml)
- return unless replace_invalid_utf8_chars && !detect_binary?(@diff)
+ return unless Feature.enabled?(:convert_diff_to_utf8_with_replacement_symbol)
+ return unless replace_invalid_utf8_chars && diff_should_be_converted?
@diff = Gitlab::EncodingHelper.encode_utf8_with_replacement_character(@diff)
end
+ def diff_should_be_converted?
+ !detect_binary?(@diff) || !@diff&.valid_encoding?
+ end
+
def init_from_hash(hash)
raw_diff = hash.symbolize_keys