1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00
This commit is contained in:
Lunny Xiao 2024-04-11 14:31:43 +08:00
parent 842d734265
commit dd0ff150bf
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -247,10 +247,10 @@ func TryInsertPackage(ctx context.Context, p *Package) (*Package, error) {
if err != nil {
return nil, err
}
if has {
return &existing, ErrDuplicatePackage
if !has {
return nil, util.ErrNotExist
}
return p, nil
return &existing, nil
}
// DeletePackageByID deletes a package by id