Fix gitea doctor will remove repo-avatar files when execute command storage-archives (#30094) (#30120)

backport #30094

(cherry picked from commit 0c10c3a282463d9ada2a6d05cfc733e742c93351)
This commit is contained in:
yp05327 2024-03-27 11:09:17 +09:00 committed by Earl Warren
parent 65d34f9313
commit e9932a404d
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -162,7 +162,7 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
if opts.RepoArchives || opts.All {
if err := commonCheckStorage(ctx, logger, autofix,
&commonStorageCheckOptions{
storer: storage.RepoAvatars,
storer: storage.RepoArchives,
isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {
exists, err := repo.ExistsRepoArchiverWithStoragePath(ctx, path)
if err == nil || errors.Is(err, util.ErrInvalidArgument) {