diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /lib/gitlab/diff/file.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'lib/gitlab/diff/file.rb')
-rw-r--r-- | lib/gitlab/diff/file.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index d1398ddb642..72dcc4fde71 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -225,6 +225,10 @@ module Gitlab new_path.presence || old_path end + def file_hash + Digest::SHA1.hexdigest(file_path) + end + def added_lines @stats&.additions || diff_lines.count(&:added?) end @@ -237,6 +241,10 @@ module Gitlab "#{file_path}-#{new_file?}-#{deleted_file?}-#{renamed_file?}" end + def file_identifier_hash + Digest::SHA1.hexdigest(file_identifier) + end + def diffable? repository.attributes(file_path).fetch('diff') { true } end |