summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorSato Hiroyuki <sathiroyuki@gmail.com>2013-02-05 14:59:13 +0900
committerSato Hiroyuki <sathiroyuki@gmail.com>2013-02-05 19:08:25 +0900
commitdf85c9c06ae3d687bb6ec2f2d11a8ae71fa8ed5f (patch)
treefa956caa14c777831e2692c6e4c3d42fce859536 /lib/extracts_path.rb
parent8ff5cf9cd5193b7135f53de3b62dd50bcbbfc2dc (diff)
downloadgitlab-ce-df85c9c06ae3d687bb6ec2f2d11a8ae71fa8ed5f.tar.gz
Fix bug when it has been switched to tag.
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 976ac018204..fb595e18b24 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -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)