0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 23:33:15 -05:00

Merge pull request '[v9.0/forgejo] log concise repo names in lfs doctor' (#5531) from bp-v9.0/forgejo-15a407a into v9.0/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5531
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Otto 2024-10-11 15:03:30 +00:00
commit 5ffa1ee883

View file

@ -52,21 +52,21 @@ func GarbageCollectLFSMetaObjects(ctx context.Context, opts GarbageCollectLFSMet
// GarbageCollectLFSMetaObjectsForRepo garbage collects LFS objects for a specific repository
func GarbageCollectLFSMetaObjectsForRepo(ctx context.Context, repo *repo_model.Repository, opts GarbageCollectLFSMetaObjectsOptions) error {
opts.LogDetail("Checking %-v", repo)
opts.LogDetail("Checking %s", repo.FullName())
total, orphaned, collected, deleted := int64(0), 0, 0, 0
defer func() {
if orphaned == 0 {
opts.LogDetail("Found %d total LFSMetaObjects in %-v", total, repo)
opts.LogDetail("Found %d total LFSMetaObjects in %s", total, repo.FullName())
} else if !opts.AutoFix {
opts.LogDetail("Found %d/%d orphaned LFSMetaObjects in %-v", orphaned, total, repo)
opts.LogDetail("Found %d/%d orphaned LFSMetaObjects in %s", orphaned, total, repo.FullName())
} else {
opts.LogDetail("Collected %d/%d orphaned/%d total LFSMetaObjects in %-v. %d removed from storage.", collected, orphaned, total, repo, deleted)
opts.LogDetail("Collected %d/%d orphaned/%d total LFSMetaObjects in %s. %d removed from storage.", collected, orphaned, total, repo.FullName(), deleted)
}
}()
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
if err != nil {
log.Error("Unable to open git repository %-v: %v", repo, err)
log.Error("Unable to open git repository %s: %v", repo.FullName(), err)
return err
}
defer gitRepo.Close()