From df85c9c06ae3d687bb6ec2f2d11a8ae71fa8ed5f Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki Date: Tue, 5 Feb 2013 14:59:13 +0900 Subject: Fix bug when it has been switched to tag. --- lib/extracts_path.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/extracts_path.rb') 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) -- cgit v1.2.1