Improve commits data loading on Tree page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-09-29 14:40:36 +03:00
parent 376e004c16
commit 44bc5fe5d6
No known key found for this signature in database
GPG Key ID: 161B5D6A44D3D88A
1 changed files with 3 additions and 1 deletions

View File

@ -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