summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-12 19:22:49 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-12 19:22:49 +0200
commit452adb7bccbe7d794aa6a5d4ea9a765020db1c7c (patch)
tree99053aa973144c28a3d028c2edb533fd634ccc76 /lib/extracts_path.rb
parentd6513b5153ae2d8bdfc3017f0cbbe909678dd37c (diff)
parent622dae76cc0e9e3c76c5d2ba18efeb139644881e (diff)
downloadgitlab-ce-452adb7bccbe7d794aa6a5d4ea9a765020db1c7c.tar.gz
Merge branch 'hiroponz-easy-to-find-commit-on-network-graph'
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)