summaryrefslogtreecommitdiff
path: root/app/models/lfs_object.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-03-05 11:16:17 +0000
committerMicaƫl Bergeron <mbergeron@gitlab.com>2018-03-08 10:20:40 -0500
commitedbcde8877f497ea675fde811065679286a1aa56 (patch)
treebeefe40d469f06fc72f2513f73b336115b0f6144 /app/models/lfs_object.rb
parent2387ef2b4a9944749f0cd1db5c7e7f55f3745780 (diff)
downloadgitlab-ce-edbcde8877f497ea675fde811065679286a1aa56.tar.gz
[cherry-pick] '4862-verify-file-checksums'
See merge request gitlab-org/gitlab-ee!4753
Diffstat (limited to 'app/models/lfs_object.rb')
-rw-r--r--app/models/lfs_object.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb
index 6c78c086662..64e88d5a6a2 100644
--- a/app/models/lfs_object.rb
+++ b/app/models/lfs_object.rb
@@ -24,4 +24,8 @@ class LfsObject < ActiveRecord::Base
.where(lfs_objects_projects: { id: nil })
.destroy_all
end
+
+ def self.calculate_oid(path)
+ Digest::SHA256.file(path).hexdigest
+ end
end