summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-12-21 17:41:33 +0100
committerJames Lopez <james@jameslopez.es>2017-01-03 13:01:46 +0100
commit112f47057275312daa876bee5bd74d5464410bc5 (patch)
tree257495d658a39b8e31c3407498ec248cb97976a6 /app/models/commit.rb
parentde25604fbca2f7005754d821d571bbcb1cc510ac (diff)
downloadgitlab-ce-112f47057275312daa876bee5bd74d5464410bc5.tar.gz
Fix cross-project references copy to include the project referencefix/cross-project-ref-path
Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 69cfc47f5bf..0b924b063a4 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -91,8 +91,8 @@ class Commit
@link_reference_pattern ||= super("commit", /(?<commit>\h{7,40})/)
end
- def to_reference(from_project = nil)
- commit_reference(from_project, id)
+ def to_reference(from_project = nil, full: false)
+ commit_reference(from_project, id, full: full)
end
def reference_link_text(from_project = nil)
@@ -320,8 +320,8 @@ class Commit
private
- def commit_reference(from_project, referable_commit_id)
- reference = project.to_reference(from_project)
+ def commit_reference(from_project, referable_commit_id, full: false)
+ reference = project.to_reference(from_project, full: full)
if reference.present?
"#{reference}#{self.class.reference_prefix}#{referable_commit_id}"