mirror of
1
Fork 0

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

Fix #30037

(cherry picked from commit 9cf0f0bb040162509702ec9aaf7df6662ecc13b1)
This commit is contained in:
yp05327 2024-03-26 17:24:13 +09:00 committed by Earl Warren
parent 82e83d3076
commit 1360e31091
No known key found for this signature in database
GPG Key ID: 0579CB2928A78A00
1 changed files with 1 additions and 1 deletions

View File

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