Change the implementation of the go-git version of GetNote to mirror the non go-git version when passed a non-existent commit (#16658)

Fixes #16657
This commit is contained in:
nitul1991 2021-08-09 20:54:34 +05:30 committed by GitHub
parent 1dc41c47b9
commit 23d438f565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,9 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note)
remainingCommitID = remainingCommitID[2:]
}
if err != nil {
if err == object.ErrDirectoryNotFound {
return ErrNotExist{ID: remainingCommitID, RelPath: path}
}
return err
}
}