Commit e1f141ac authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

gfm should respect @ref value when build relative links

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent e4c6dbe3
...@@ -179,9 +179,13 @@ module GitlabMarkdownHelper ...@@ -179,9 +179,13 @@ module GitlabMarkdownHelper
if @commit if @commit
@commit.id @commit.id
elsif @repository && !@repository.empty? elsif @repository && !@repository.empty?
if @ref
@repository.commit(@ref).try(:sha)
else
@repository.head_commit.sha @repository.head_commit.sha
end end
end end
end
# We will assume that if no ref exists we can point to master # We will assume that if no ref exists we can point to master
def correct_ref def correct_ref
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment