fix: refactor git error handling and make archive streaming handle non-existing commit id (#38007)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Sandro
2026-06-06 11:06:08 +00:00
committed by GitHub
co-authored by wxiaoguang
parent e88650cfcf
commit 743bbaa9c2
10 changed files with 57 additions and 50 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ func prepareGitPath(gitRepo *git.Repository, defaultWikiBranch string, wikiPath
// Look for both files
filesInIndex, err := gitRepo.LsTree(defaultWikiBranch, unescaped, gitPath)
if err != nil {
if gitcmd.IsStdErrorNotValidObjectName(err) {
if gitcmd.IsStderr(err, gitcmd.StderrNotValidObjectName) {
return false, gitPath, nil // branch doesn't exist
}
log.Error("Wiki LsTree failed, err: %v", err)