Commit df85c9c06ae3d687bb6ec2f2d11a8ae71fa8ed5f
1 parent
8ff5cf9c
Exists in
master
and in
4 other branches
Fix bug when it has been switched to tag.
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
lib/extracts_path.rb
| ... | ... | @@ -117,7 +117,10 @@ module ExtractsPath |
| 117 | 117 | |
| 118 | 118 | @id = File.join(@ref, @path) |
| 119 | 119 | |
| 120 | - @commit = CommitDecorator.decorate(@project.repository.commit(@ref)) | |
| 120 | + # It is used "@project.repository.commits(@ref, @path, 1, 0)", | |
| 121 | + # because "@project.repository.commit(@ref)" returns wrong commit when @ref is tag name. | |
| 122 | + commits = @project.repository.commits(@ref, @path, 1, 0) | |
| 123 | + @commit = CommitDecorator.decorate(commits.first) | |
| 121 | 124 | |
| 122 | 125 | @tree = Tree.new(@commit.tree, @ref, @path) |
| 123 | 126 | @tree = TreeDecorator.new(@tree) | ... | ... |
lib/gitlab/graph/json_builder.rb
| ... | ... | @@ -113,7 +113,7 @@ module Gitlab |
| 113 | 113 | |
| 114 | 114 | def include_ref?(commit) |
| 115 | 115 | heads = commit.refs.select do |ref| |
| 116 | - ref.is_a?(Grit::Head) or ref.is_a?(Grit::Remote) | |
| 116 | + ref.is_a?(Grit::Head) or ref.is_a?(Grit::Remote) or ref.is_a?(Grit::Tag) | |
| 117 | 117 | end |
| 118 | 118 | |
| 119 | 119 | heads.map! do |head| | ... | ... |