summaryrefslogtreecommitdiffstats
path: root/modules/git/notes_nogogit.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-10-08 14:08:22 +0100
committerGitHub <noreply@github.com>2021-10-08 15:08:22 +0200
commit001dbf100de40f19c7ade5b8f013fbcccbe09ec3 (patch)
tree0b1a57f8efbb2e941fe4c344005a70ec76ad57d1 /modules/git/notes_nogogit.go
parent88fa9f3fb168bc6c9c2bdc6341b83bc048b38846 (diff)
downloadgitea-001dbf100de40f19c7ade5b8f013fbcccbe09ec3.tar.gz
gitea-001dbf100de40f19c7ade5b8f013fbcccbe09ec3.zip
Defer Last Commit Info (#16467)
One of the biggest reasons for slow repository browsing is that we wait until last commit information has been generated for all files in the repository. This PR proposes deferring this generation to a new POST endpoint that does the look up outside of the main page request. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/git/notes_nogogit.go')
-rw-r--r--modules/git/notes_nogogit.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/git/notes_nogogit.go b/modules/git/notes_nogogit.go
index 5afe8d4614..13b4b7b36a 100644
--- a/modules/git/notes_nogogit.go
+++ b/modules/git/notes_nogogit.go
@@ -16,6 +16,7 @@ import (
)
// GetNote retrieves the git-notes data for a given commit.
+// FIXME: Add LastCommitCache support
func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note) error {
log.Trace("Searching for git note corresponding to the commit %q in the repository %q", commitID, repo.Path)
notes, err := repo.GetCommit(NotesRef)
@@ -75,7 +76,7 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note)
path = path[idx+1:]
}
- lastCommits, err := GetLastCommitForPaths(ctx, notes, treePath, []string{path})
+ lastCommits, err := GetLastCommitForPaths(ctx, nil, notes, treePath, []string{path})
if err != nil {
log.Error("Unable to get the commit for the path %q. Error: %v", treePath, err)
return err