diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index ba993abf7f72fdf153b000e82867868c65d5845d..fab89d09896bff29badcc2a90a46cd132c96fd66 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -173,7 +173,7 @@ module Gitlab end def reference_commit(identifier) - if commit = @project.commit(identifier) + if @project.valid_repo? && commit = @project.commit(identifier) link_to(identifier, project_commit_path(@project, commit), html_options.merge(title: CommitDecorator.new(commit).link_title, class: "gfm gfm-commit #{html_options[:class]}")) end end