summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/repository.rb
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2018-08-07 06:13:48 -0500
committerRubén Dávila <ruben@gitlab.com>2018-08-07 06:13:48 -0500
commit5c748a0bd9665c2036340d3f2b475df013810e62 (patch)
tree241867bdf9ad5684f1992df013dbe386784f55d3 /lib/gitlab/git/repository.rb
parentd737abc537476bf2b500f550b0c733d22f338cf1 (diff)
downloadgitlab-ce-5c748a0bd9665c2036340d3f2b475df013810e62.tar.gz
Backport some changes from gitlab-org/gitlab-ee!6767
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r--lib/gitlab/git/repository.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 73151e4a4c5..de189ac6dfc 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -19,6 +19,7 @@ module Gitlab
GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE
].freeze
SEARCH_CONTEXT_LINES = 3
+ REV_LIST_COMMIT_LIMIT = 2_000
# In https://gitlab.com/gitlab-org/gitaly/merge_requests/698
# We copied these two prefixes into gitaly-go, so don't change these
# or things will break! (REBASE_WORKTREE_PREFIX and SQUASH_WORKTREE_PREFIX)
@@ -380,6 +381,16 @@ module Gitlab
end
end
+ def new_blobs(newrev)
+ return [] if newrev == ::Gitlab::Git::BLANK_SHA
+
+ strong_memoize("new_blobs_#{newrev}") do
+ wrapped_gitaly_errors do
+ gitaly_ref_client.list_new_blobs(newrev, REV_LIST_COMMIT_LIMIT)
+ end
+ end
+ end
+
def count_commits(options)
options = process_count_commits_options(options.dup)