summaryrefslogtreecommitdiff
path: root/lib/banzai/filter/relative_link_filter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/filter/relative_link_filter.rb')
-rw-r--r--lib/banzai/filter/relative_link_filter.rb6
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 46762d401fb..4fa8d05481f 100644
--- a/lib/banzai/filter/relative_link_filter.rb
+++ b/lib/banzai/filter/relative_link_filter.rb
@@ -52,7 +52,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('/')
@@ -116,7 +116,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
@@ -124,7 +124,7 @@ module Banzai
end
def ref
- context[:ref]
+ context[:ref] || context[:project].default_branch
end
def repository