summaryrefslogtreecommitdiff
path: root/app/models/commit_range.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-01 12:58:45 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-01 12:58:45 +0100
commit62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909 (patch)
tree09df506c6905a490613a6fd31edc8004b3c15495 /app/models/commit_range.rb
parentbd4ab21c07061e06166b08d86157e4004665ccbc (diff)
downloadgitlab-ce-62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909.tar.gz
Render commit reference using short sha, but include full sha in comment.
Diffstat (limited to 'app/models/commit_range.rb')
-rw-r--r--app/models/commit_range.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/commit_range.rb b/app/models/commit_range.rb
index 449689faf65..f786a749b8e 100644
--- a/app/models/commit_range.rb
+++ b/app/models/commit_range.rb
@@ -95,6 +95,14 @@ class CommitRange
alias_method :id, :to_s
def to_reference(from_project = nil)
+ if cross_project_reference?(from_project)
+ reference = project.to_reference + self.class.reference_prefix + self.id
+ else
+ self.id
+ end
+ end
+
+ def reference_link_text(from_project = nil)
reference = ref_from + notation + ref_to
if cross_project_reference?(from_project)