Skip to content
Snippets Groups Projects
Commit df85c9c0 authored by Sato Hiroyuki's avatar Sato Hiroyuki
Browse files

Fix bug when it has been switched to tag.

parent 8ff5cf9c
No related branches found
No related tags found
1 merge request!2910Easy to find commit on network graph
Loading
Loading
@@ -117,7 +117,10 @@ module ExtractsPath
 
@id = File.join(@ref, @path)
 
@commit = CommitDecorator.decorate(@project.repository.commit(@ref))
# It is used "@project.repository.commits(@ref, @path, 1, 0)",
# because "@project.repository.commit(@ref)" returns wrong commit when @ref is tag name.
commits = @project.repository.commits(@ref, @path, 1, 0)
@commit = CommitDecorator.decorate(commits.first)
 
@tree = Tree.new(@commit.tree, @ref, @path)
@tree = TreeDecorator.new(@tree)
Loading
Loading
Loading
Loading
@@ -113,7 +113,7 @@ module Gitlab
 
def include_ref?(commit)
heads = commit.refs.select do |ref|
ref.is_a?(Grit::Head) or ref.is_a?(Grit::Remote)
ref.is_a?(Grit::Head) or ref.is_a?(Grit::Remote) or ref.is_a?(Grit::Tag)
end
 
heads.map! do |head|
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment