Backport #31790 by @wolfogre Fix #31271. When gogit is enabled, `IsObjectExist` calls `repo.gogitRepo.ResolveRevision`, which is not correct. It's for checking references not objects, it could work with commit hash since it's both a valid reference and a commit object, but it doesn't work with blob objects. So it causes #31271 because it reports that all blob objects do not exist. Co-authored-by: Jason Song <i@wolfogre.com>
This commit is contained in:
parent
8d11946d67
commit
144648a4af
4 changed files with 127 additions and 16 deletions
|
@ -16,7 +16,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
// IsObjectExist returns true if given reference exists in the repository.
|
||||
// IsObjectExist returns true if the given object exists in the repository.
|
||||
func (repo *Repository) IsObjectExist(name string) bool {
|
||||
if name == "" {
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue