diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-08-25 04:30:12 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-11-01 19:41:05 +0300 |
commit | fb3f9c6e507b232649757e996243e292064b32bb (patch) | |
tree | 08e39e77c7ca8f2e2d2305a286127c4bc3b66038 /lib/gitlab/git/repository.rb | |
parent | b5e7035c1a5e89845faada20addff98fdcefbd1e (diff) |
Detect changes to LFS pointers for pruning and integrity check
Gitlab::Git::Blob.batch_lfs_metadata can be used to check for LFS pointers. It uses a lazy enumorator and filters by blob size
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r-- | lib/gitlab/git/repository.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 59a54b48ed9..9c407b1b1c2 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -290,6 +290,14 @@ module Gitlab end end + def batch_existence(object_ids, existing: true) + filter_method = existing ? :select : :reject + + object_ids.public_send(filter_method) do |oid| # rubocop:disable GitlabSecurity/PublicSend + rugged.exists?(oid) + end + end + # Returns an Array of branch and tag names def ref_names branch_names + tag_names |