summaryrefslogtreecommitdiff
path: root/lib/gitlab/verify/lfs_objects.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-02-27 19:15:25 +0000
committerNick Thomas <nick@gitlab.com>2018-03-02 14:16:17 +0000
commit6f945f20b4c3683bc862ebc476bad9331d72784e (patch)
tree9504637169d3a410e03e9e75f1d72ee6a323187f /lib/gitlab/verify/lfs_objects.rb
parent40c61acb6a9ba84928cebcbce8b57630bd439615 (diff)
downloadgitlab-ce-ee-4862-verify-file-checksums.tar.gz
Foreground verification of uploads and LFS objectsee-4862-verify-file-checksums
Diffstat (limited to 'lib/gitlab/verify/lfs_objects.rb')
-rw-r--r--lib/gitlab/verify/lfs_objects.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/gitlab/verify/lfs_objects.rb b/lib/gitlab/verify/lfs_objects.rb
new file mode 100644
index 00000000000..fe51edbdeeb
--- /dev/null
+++ b/lib/gitlab/verify/lfs_objects.rb
@@ -0,0 +1,27 @@
+module Gitlab
+ module Verify
+ class LfsObjects < BatchVerifier
+ def name
+ 'LFS objects'
+ end
+
+ def describe(object)
+ "LFS object: #{object.oid}"
+ end
+
+ private
+
+ def relation
+ LfsObject.all
+ end
+
+ def expected_checksum(lfs_object)
+ lfs_object.oid
+ end
+
+ def actual_checksum(lfs_object)
+ LfsObject.calculate_oid(lfs_object.file.path)
+ end
+ end
+ end
+end