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
+3 -3
View File
@@ -24,9 +24,9 @@ func (repo *Repository) GetTagCommitID(name string) (string, error) {
return repo.GetRefCommitID(TagPrefix + name)
}
// GetCommit returns commit object of by ID string.
func (repo *Repository) GetCommit(commitID string) (*Commit, error) {
id, err := repo.ConvertToGitID(commitID)
// GetCommit returns a commit object of by the git ref.
func (repo *Repository) GetCommit(ref string) (*Commit, error) {
id, err := repo.ConvertToGitID(ref)
if err != nil {
return nil, err
}