diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-09-18 17:58:49 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-09-19 21:01:20 +0300 |
commit | 70cfcb144f9527b6c3a5cfb1b93e29b814817b6f (patch) | |
tree | 0275b529c73be6ed82f2e7423a61b4cfb5d655ad | |
parent | e6df3d9ff81a70946827edc4ca7c2acf87804901 (diff) |
Cleanup: Use the Git DSL for command exection
After https://gitlab.com/gitlab-org/gitaly/merge_requests/1476 was
merged, this command could be rewritten.
-rw-r--r-- | internal/service/repository/cleanup.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/service/repository/cleanup.go b/internal/service/repository/cleanup.go index 7ed72bef8..141a61507 100644 --- a/internal/service/repository/cleanup.go +++ b/internal/service/repository/cleanup.go @@ -135,7 +135,10 @@ func cleanStaleWorktrees(repoPath string, threshold time.Time) error { } func cleanDisconnectedWorktrees(ctx context.Context, repo *gitalypb.Repository) error { - cmd, err := git.Command(ctx, repo, "worktree", "prune") + cmd, err := git.SafeCmd(ctx, repo, nil, git.SubCmd{ + Name: "worktree", + Flags: []git.Option{git.SubSubCmd{"prune"}}, + }) if err != nil { return err } |