1
1
Fork 1
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-06 09:06:06 +02:00

Resolve panic on failed interface conversion in migration v156 (#15604)

go panics otherwise with `panic: interface conversion: error is git.ErrNotExist, not *git.ErrNotExist`, thanks to Codeberg/Andi for reporting this.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
techknowlogick 2021-04-23 23:14:39 -04:00 committed by GitHub
parent 1b3dbdba4e
commit ea40eb749b
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,7 @@ func fixPublisherIDforTagReleases(x *xorm.Engine) error {
commit, err := gitRepo.GetTagCommit(release.TagName)
if err != nil {
if git.IsErrNotExist(err) {
log.Warn("Unable to find commit %s for Tag: %s in %-v. Cannot update publisher ID.", err.(*git.ErrNotExist).ID, release.TagName, repo)
log.Warn("Unable to find commit %s for Tag: %s in %-v. Cannot update publisher ID.", err.(git.ErrNotExist).ID, release.TagName, repo)
continue
}
log.Error("Error whilst getting commit for Tag: %s in %-v.", release.TagName, repo)