diff options
author | Nick Thomas <nick@gitlab.com> | 2018-02-27 19:15:25 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-03-02 14:16:17 +0000 |
commit | 6f945f20b4c3683bc862ebc476bad9331d72784e (patch) | |
tree | 9504637169d3a410e03e9e75f1d72ee6a323187f /lib/gitlab/verify/lfs_objects.rb | |
parent | 40c61acb6a9ba84928cebcbce8b57630bd439615 (diff) | |
download | gitlab-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.rb | 27 |
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 |