summaryrefslogtreecommitdiff
path: root/app/models/commit_range.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-30 21:14:46 +0100
committerDouwe Maan <douwe@gitlab.com>2015-11-30 21:36:34 +0100
commitd6a5b45c8ea5ec7a68e213636fde405c52bb90e4 (patch)
treee711cd92c57e20cc7900875017fb93d670537c00 /app/models/commit_range.rb
parenta7be01cd07430a4302668224947b2ed135c2d7bb (diff)
downloadgitlab-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.rb11
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.