gitea源码

fsck.go 490B

1234567891011121314151617
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package gitrepo
  4. import (
  5. "context"
  6. "time"
  7. "code.gitea.io/gitea/modules/git/gitcmd"
  8. )
  9. // Fsck verifies the connectivity and validity of the objects in the database
  10. func Fsck(ctx context.Context, repo Repository, timeout time.Duration, args gitcmd.TrustedCmdArgs) error {
  11. return gitcmd.NewCommand("fsck").AddArguments(args...).Run(ctx, &gitcmd.RunOpts{Timeout: timeout, Dir: repoPath(repo)})
  12. }