diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-30 21:14:46 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-30 21:36:34 +0100 |
commit | d6a5b45c8ea5ec7a68e213636fde405c52bb90e4 (patch) | |
tree | e711cd92c57e20cc7900875017fb93d670537c00 /app/models/commit_range.rb | |
parent | a7be01cd07430a4302668224947b2ed135c2d7bb (diff) | |
download | gitlab-ce-d6a5b45c8ea5ec7a68e213636fde405c52bb90e4.tar.gz |
Recognize issue/MR/snippet/commit links as references.
Diffstat (limited to 'app/models/commit_range.rb')
-rw-r--r-- | app/models/commit_range.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/commit_range.rb b/app/models/commit_range.rb index fd23e24aff6..98067771b71 100644 --- a/app/models/commit_range.rb +++ b/app/models/commit_range.rb @@ -42,11 +42,18 @@ class CommitRange # This pattern supports cross-project references. def self.reference_pattern %r{ - (?:#{Project.reference_pattern}#{reference_prefix})? - (?<commit_range>#{PATTERN}) + #{link_reference_pattern} | + (?: + (?:#{Project.reference_pattern}#{reference_prefix})? + (?<commit_range>#{PATTERN}) + ) }x end + def self.link_reference_pattern + super("compare", /(?<commit_range>#{PATTERN})/) + end + # Initialize a CommitRange # # range_string - The String commit range. |