mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 00:02:43 +02:00
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:
1 parent
8d11946d67
commit
144648a4af
4 files changed
+127
-16
No files matched your search
@@ -1159,7 +1159,8 @@ func hashCurrentPatternProcessor(ctx *RenderContext, node *html.Node) {
|
||||
})
|
||||
}
|
||||
|
||||
exist = ctx.GitRepo.IsObjectExist(hash)
|
||||
// Don't use IsObjectExist since it doesn't support short hashs with gogit edition.
|
||||
exist = ctx.GitRepo.IsReferenceExist(hash)
|
||||
ctx.ShaExistCache[hash] = exist
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user