Commit 19a30595 authored by Douwe Maan's avatar Douwe Maan

Remove unnecessary comments

parent 91b40b3b
...@@ -25,7 +25,6 @@ class Commit ...@@ -25,7 +25,6 @@ class Commit
DIFF_HARD_LIMIT_FILES = 1000 DIFF_HARD_LIMIT_FILES = 1000
DIFF_HARD_LIMIT_LINES = 50000 DIFF_HARD_LIMIT_LINES = 50000
# The SHA can be between 7 and 40 hex characters.
MIN_SHA_LENGTH = 7 MIN_SHA_LENGTH = 7
COMMIT_SHA_PATTERN = /\h{#{MIN_SHA_LENGTH},40}/.freeze COMMIT_SHA_PATTERN = /\h{#{MIN_SHA_LENGTH},40}/.freeze
...@@ -217,7 +216,6 @@ class Commit ...@@ -217,7 +216,6 @@ class Commit
@raw.respond_to?(method, include_private) || super @raw.respond_to?(method, include_private) || super
end end
# Truncate sha to 7 characters
def short_id def short_id
@raw.short_id(MIN_SHA_LENGTH) @raw.short_id(MIN_SHA_LENGTH)
end end
......
...@@ -57,8 +57,8 @@ module Gitlab ...@@ -57,8 +57,8 @@ module Gitlab
length = [sha1.length, sha2.length].min length = [sha1.length, sha2.length].min
# If either of the shas is below 7 characters in length, we cannot be sure # If either of the shas is below the minimum length, we cannot be sure
# if they actually refer to the same commit because of hash collision. # that they actually refer to the same commit because of hash collision.
return false if length < Commit::MIN_SHA_LENGTH return false if length < Commit::MIN_SHA_LENGTH
sha1[0, length] == sha2[0, length] sha1[0, length] == sha2[0, length]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment