summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authormicael.bergeron <micaelbergeron@gmail.com>2017-11-15 09:12:04 -0500
committermicael.bergeron <micaelbergeron@gmail.com>2017-11-15 09:21:05 -0500
commit4374a38f0e8fbd856458a60f47083fb4d084d695 (patch)
treede063112d0909ac1c4fe0ad2c25f4466951a9abf /app/models/commit.rb
parenta4072db0198896242886d22c644ed91c1016aa8d (diff)
downloadgitlab-ce-4374a38f0e8fbd856458a60f47083fb4d084d695.tar.gz
fix the commit reference pattern from matching other entities
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 6dba154a6ea..e28bf28fab3 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -26,7 +26,7 @@ class Commit
DIFF_HARD_LIMIT_LINES = 50000
MIN_SHA_LENGTH = 7
- COMMIT_SHA_PATTERN = /\h{#{MIN_SHA_LENGTH},40}/.freeze
+ COMMIT_SHA_PATTERN = /\b(?<![~#!@:])\h{#{MIN_SHA_LENGTH},40}/.freeze
def banzai_render_context(field)
context = { pipeline: :single_line, project: self.project }