diff options
author | John Cai <jcai@gitlab.com> | 2019-09-19 23:58:35 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-09-19 23:58:35 +0300 |
commit | 939f16257b6ada62a1d78560c942468580f9472d (patch) | |
tree | d7fc7a2eec4b069d55d60fa33adbe5cffcbab534 | |
parent | 0e27aea8a52d81b962ad245345f79a4c967d2882 (diff) | |
parent | 70cfcb144f9527b6c3a5cfb1b93e29b814817b6f (diff) |
Merge branch 'zj-worktree-prune-safedsl' into 'master'
Cleanup: Use the Git DSL for command exection
Closes #1985
See merge request gitlab-org/gitaly!1497
-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 } |