summaryrefslogtreecommitdiffstats
path: root/modules/git/notes.go
diff options
context:
space:
mode:
authorFilip Navara <filip.navara@gmail.com>2019-07-02 04:15:14 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2019-07-02 10:15:14 +0800
commit6e2a59e4ceb89c4e369a5ff1cac95c31f7e7ecd6 (patch)
tree00955179d6e1b61285c4f625acbfa1599276b041 /modules/git/notes.go
parente728b5581291d6d9a62fcd8ab2c3b2e6c89b7138 (diff)
downloadgitea-6e2a59e4ceb89c4e369a5ff1cac95c31f7e7ecd6.tar.gz
gitea-6e2a59e4ceb89c4e369a5ff1cac95c31f7e7ecd6.zip
Use commit graph files for listing pages (#7314)
* Experimental support for git commit graph files and bloom filter index Signed-off-by: Filip Navara <filip.navara@gmail.com> * Force vendor of commitgraph Signed-off-by: Filip Navara <filip.navara@gmail.com> * Remove bloom filter experiment and debug prints * Remove old code for building commit graphs * Remove unused function * Remove mmap usage * gofmt * sort vendor/modules.txt * Add copyright header and log commit-graph error
Diffstat (limited to 'modules/git/notes.go')
-rw-r--r--modules/git/notes.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/git/notes.go b/modules/git/notes.go
index 7aa5d89a79..a62c558787 100644
--- a/modules/git/notes.go
+++ b/modules/git/notes.go
@@ -50,7 +50,17 @@ func GetNote(repo *Repository, commitID string, note *Note) error {
return err
}
- lastCommits, err := getLastCommitForPaths(commit, "", []string{commitID})
+ commitNodeIndex, commitGraphFile := repo.CommitNodeIndex()
+ if commitGraphFile != nil {
+ defer commitGraphFile.Close()
+ }
+
+ commitNode, err := commitNodeIndex.Get(commit.Hash)
+ if err != nil {
+ return nil
+ }
+
+ lastCommits, err := getLastCommitForPaths(commitNode, "", []string{commitID})
if err != nil {
return err
}