Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
19a30595
Commit
19a30595
authored
Sep 25, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary comments
parent
91b40b3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
app/models/commit.rb
app/models/commit.rb
+0
-2
lib/gitlab/diff/diff_refs.rb
lib/gitlab/diff/diff_refs.rb
+2
-2
No files found.
app/models/commit.rb
View file @
19a30595
...
...
@@ -25,7 +25,6 @@ class Commit
DIFF_HARD_LIMIT_FILES
=
1000
DIFF_HARD_LIMIT_LINES
=
50000
# The SHA can be between 7 and 40 hex characters.
MIN_SHA_LENGTH
=
7
COMMIT_SHA_PATTERN
=
/\h{
#{
MIN_SHA_LENGTH
}
,40}/
.
freeze
...
...
@@ -217,7 +216,6 @@ class Commit
@raw
.
respond_to?
(
method
,
include_private
)
||
super
end
# Truncate sha to 7 characters
def
short_id
@raw
.
short_id
(
MIN_SHA_LENGTH
)
end
...
...
lib/gitlab/diff/diff_refs.rb
View file @
19a30595
...
...
@@ -57,8 +57,8 @@ module Gitlab
length
=
[
sha1
.
length
,
sha2
.
length
].
min
# If either of the shas is below
7 characters in
length, we cannot be sure
#
if
they actually refer to the same commit because of hash collision.
# If either of the shas is below
the minimum
length, we cannot be sure
#
that
they actually refer to the same commit because of hash collision.
return
false
if
length
<
Commit
::
MIN_SHA_LENGTH
sha1
[
0
,
length
]
==
sha2
[
0
,
length
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment