From 44bc5fe5d69953278aa6ce84c55a72dab49761cf Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 29 Sep 2014 14:40:36 +0300 Subject: [PATCH] Improve commits data loading on Tree page Signed-off-by: Dmitriy Zaporozhets --- app/models/repository.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index b7ca6e0919..ea87ea88fd 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -223,7 +223,9 @@ class Repository end def last_commit_for_path(sha, path) - commits(sha, path, 1).last + args = %W(git rev-list --max-count 1 #{sha} -- #{path}) + sha = Gitlab::Popen.popen(args, path_to_repo).first.strip + commit(sha) end # Remove archives older than 2 hours