Fine tune git command verbosity flags

This commit is contained in:
Tim Hockin 2023-02-18 17:17:07 -08:00
parent 07df59eccc
commit 76e91a2304
1 changed files with 6 additions and 4 deletions

View File

@ -1115,7 +1115,8 @@ func (git *repoSync) sanityCheckRepo(ctx context.Context) bool {
}
}
// Consistency-check the repo.
// Consistency-check the repo. Don't use --verbose because it can be
// REALLY verbose.
if _, err := git.run.Run(ctx, git.root, nil, git.cmd, "fsck", "--no-progress", "--connectivity-only"); err != nil {
git.log.Error(err, "repo fsck failed", "path", git.root)
return false
@ -1142,7 +1143,8 @@ func (git *repoSync) sanityCheckWorktree(ctx context.Context, sha string) bool {
return false
}
// Consistency-check the worktree.
// Consistency-check the worktree. Don't use --verbose because it can be
// REALLY verbose.
if _, err := git.run.Run(ctx, worktreePath, nil, git.cmd, "fsck", "--no-progress", "--connectivity-only"); err != nil {
git.log.Error(err, "worktree fsck failed", "path", worktreePath)
return false
@ -1231,7 +1233,7 @@ func (git *repoSync) cleanupWorktree(ctx context.Context, worktree string) error
if err := os.RemoveAll(worktree); err != nil {
return fmt.Errorf("error removing directory: %v", err)
}
if _, err := git.run.Run(ctx, git.root, nil, git.cmd, "worktree", "prune"); err != nil {
if _, err := git.run.Run(ctx, git.root, nil, git.cmd, "worktree", "prune", "--verbose"); err != nil {
return err
}
return nil
@ -1557,7 +1559,7 @@ func (git *repoSync) fetch(ctx context.Context, ref string) error {
// Fetch the ref and do some cleanup, setting or un-setting the repo's
// shallow flag as appropriate.
args := []string{"fetch", git.repo, ref, "--prune", "--no-auto-gc"}
args := []string{"fetch", git.repo, ref, "--verbose", "--no-progress", "--prune", "--no-auto-gc"}
if git.depth > 0 {
args = append(args, "--depth", strconv.Itoa(git.depth))
} else {