diff options
author | winniehell <git@winniehell.de> | 2016-08-01 02:43:29 +0200 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2016-08-02 21:52:52 +0200 |
commit | e63eccf9744de0965d4727326a4b30f1fe8165e8 (patch) | |
tree | bbc731d32474e381442a90dff7e7386c342a83a8 /lib | |
parent | 4dd1f95516731465caa523be402400f56a53a4e9 (diff) | |
download | gitlab-ce-e63eccf9744de0965d4727326a4b30f1fe8165e8.tar.gz |
Do not look up commit again when it is passed to RelativeLinkFilter (!5455)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/relative_link_filter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb index 5b73fc8fcee..7d172ccdb8f 100644 --- a/lib/banzai/filter/relative_link_filter.rb +++ b/lib/banzai/filter/relative_link_filter.rb @@ -51,7 +51,7 @@ module Banzai relative_url_root, context[:project].path_with_namespace, uri_type(file_path), - ref || context[:project].default_branch, # if no ref exists, point to the default branch + ref, file_path ].compact.join('/').squeeze('/').chomp('/') @@ -115,7 +115,7 @@ module Banzai end def current_commit - @current_commit ||= context[:commit] || ref ? repository.commit(ref) : repository.head_commit + @current_commit ||= context[:commit] || repository.commit(ref) end def relative_url_root @@ -123,7 +123,7 @@ module Banzai end def ref - context[:ref] + context[:ref] || context[:project].default_branch end def repository |