You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2019/11/19 22:33:37 UTC

[allura] 01/02: [#8342] optimise LastCommit a bit when at top-level dir

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8342
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 2ceaf44880a55c383d6b1a69b7c7836c96033db9
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Nov 19 17:03:57 2019 -0500

    [#8342] optimise LastCommit a bit when at top-level dir
---
 Allura/allura/model/repository.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 3151b5a..71c1569 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1548,6 +1548,9 @@ class LastCommit(RepoObject):
 
     @classmethod
     def _last_commit_id(cls, commit, path):
+        if path == '':
+            # on the top-level dir, the relevant commit should always be the current commit
+            return commit._id
         try:
             rev = commit.repo.log(commit._id, path, id_only=True, limit=1).next()
             return commit.repo.rev_to_commit_id(rev)