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-07-20 18:40:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /lib/gitlab/git
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/blob.rb3
-rw-r--r--lib/gitlab/git/conflict/parser.rb2
-rw-r--r--lib/gitlab/git/repository.rb4
-rw-r--r--lib/gitlab/git/rugged_impl/tree.rb5
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb
index f72217dedde..bb5bbeeb27e 100644
--- a/lib/gitlab/git/blob.rb
+++ b/lib/gitlab/git/blob.rb
@@ -128,6 +128,9 @@ module Gitlab
@loaded_size = @data.bytesize if @data
@loaded_all_data = @loaded_size == size
+ # Recalculate binary status if we loaded all data
+ @binary = nil if @loaded_all_data
+
record_metric_blob_size
record_metric_truncated(truncated?)
end
diff --git a/lib/gitlab/git/conflict/parser.rb b/lib/gitlab/git/conflict/parser.rb
index 20de8ebde4e..670305de95b 100644
--- a/lib/gitlab/git/conflict/parser.rb
+++ b/lib/gitlab/git/conflict/parser.rb
@@ -27,7 +27,7 @@ module Gitlab
conflict_end = ">>>>>>> #{their_path}"
text.each_line.map do |line|
- full_line = line.delete("\n")
+ full_line = line.chomp
if full_line == conflict_start
validate_delimiter!(type.nil?)
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index df744bd60b4..d7f892ae9d9 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -800,9 +800,9 @@ module Gitlab
end
end
- def list_refs
+ def list_refs(patterns = [Gitlab::Git::BRANCH_REF_PREFIX])
wrapped_gitaly_errors do
- gitaly_ref_client.list_refs
+ gitaly_ref_client.list_refs(patterns)
end
end
diff --git a/lib/gitlab/git/rugged_impl/tree.rb b/lib/gitlab/git/rugged_impl/tree.rb
index 40c003821b9..bc0af12d7e3 100644
--- a/lib/gitlab/git/rugged_impl/tree.rb
+++ b/lib/gitlab/git/rugged_impl/tree.rb
@@ -63,10 +63,7 @@ module Gitlab
def tree_entries_with_flat_path_from_rugged(repository, sha, path, recursive)
tree_entries_from_rugged(repository, sha, path, recursive).tap do |entries|
# This was an optimization to reduce N+1 queries for Gitaly
- # (https://gitlab.com/gitlab-org/gitaly/issues/530). It
- # used to be done lazily in the view via
- # TreeHelper#flatten_tree, so it's possible there's a
- # performance impact by loading this eagerly.
+ # (https://gitlab.com/gitlab-org/gitaly/issues/530).
rugged_populate_flat_path(repository, sha, path, entries)
end
end