Update go dependencies and fix go-git (#28893)

More details are in the comment of repo_base_gogit.go

And ref: https://github.com/go-git/go-git/issues/1006
This commit is contained in:
wxiaoguang 2024-01-23 13:40:00 +08:00 committed by GitHub
parent c4cdebacfe
commit 82acf22d9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 158 additions and 160 deletions

View file

@ -12,7 +12,7 @@ import (
gitealog "code.gitea.io/gitea/modules/log"
"github.com/go-git/go-git/v5/plumbing/format/commitgraph"
commitgraph "github.com/go-git/go-git/v5/plumbing/format/commitgraph/v2"
cgobject "github.com/go-git/go-git/v5/plumbing/object/commitgraph"
)
@ -22,7 +22,7 @@ func (r *Repository) CommitNodeIndex() (cgobject.CommitNodeIndex, *os.File) {
file, err := os.Open(indexPath)
if err == nil {
var index commitgraph.Index // TODO: in newer go-git, it might need to use "github.com/go-git/go-git/v5/plumbing/format/commitgraph/v2" package to compile
var index commitgraph.Index
index, err = commitgraph.OpenFileIndex(file)
if err == nil {
return cgobject.NewGraphCommitNodeIndex(index, r.gogitRepo.Storer), file