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:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2017-11-03 17:33:06 +0300
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-11-06 13:20:14 +0300
commitca049902dc7dad6e6177b05c8e3dc74c00487d27 (patch)
tree47f7bc6019deab6b51b7c1a9f6321a6001a559ed /lib/gitlab/git/lfs_changes.rb
parent95640413e64c4a857bcfcf7a4dcf0ce79189f894 (diff)
Gitlab::Git::RevList and LfsChanges use lazy popen
Diffstat (limited to 'lib/gitlab/git/lfs_changes.rb')
-rw-r--r--lib/gitlab/git/lfs_changes.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/gitlab/git/lfs_changes.rb b/lib/gitlab/git/lfs_changes.rb
index 2749e2e69e2..732dd5d998a 100644
--- a/lib/gitlab/git/lfs_changes.rb
+++ b/lib/gitlab/git/lfs_changes.rb
@@ -8,25 +8,22 @@ module Gitlab
def new_pointers(object_limit: nil, not_in: nil)
@new_pointers ||= begin
- object_ids = new_objects(not_in: not_in)
- object_ids = object_ids.take(object_limit) if object_limit
+ rev_list.new_objects(not_in: not_in, require_path: true) do |object_ids|
+ object_ids = object_ids.take(object_limit) if object_limit
- Gitlab::Git::Blob.batch_lfs_pointers(@repository, object_ids)
+ Gitlab::Git::Blob.batch_lfs_pointers(@repository, object_ids)
+ end
end
end
def all_pointers
- object_ids = rev_list.all_objects(require_path: true)
-
- Gitlab::Git::Blob.batch_lfs_pointers(@repository, object_ids)
+ rev_list.all_objects(require_path: true) do |object_ids|
+ Gitlab::Git::Blob.batch_lfs_pointers(@repository, object_ids)
+ end
end
private
- def new_objects(not_in:)
- rev_list.new_objects(require_path: true, lazy: true, not_in: not_in)
- end
-
def rev_list
::Gitlab::Git::RevList.new(path_to_repo: @repository.path_to_repo,
newrev: @newrev)