diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-09-19 14:28:04 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-09-19 14:28:04 +0300 |
commit | b3731e92896b3241a9e2dad174c488d0f78a6b6d (patch) | |
tree | 6cadad934e25b600bb8f499fc4bce2b93b0b035d /internal | |
parent | bd7a608b36e85c08fda8ec4f6704660b071ccdf5 (diff) | |
parent | 630c801403e7c7476686b390b9321a940454a1af (diff) |
Merge branch 'jc-safe-cmd-on-repository' into 'master'
Use safe command in HasLocalBranches
See merge request gitlab-org/gitaly!1499
Diffstat (limited to 'internal')
-rw-r--r-- | internal/service/repository/repository.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/service/repository/repository.go b/internal/service/repository/repository.go index 1e1f71c40..e0282e994 100644 --- a/internal/service/repository/repository.go +++ b/internal/service/repository/repository.go @@ -26,8 +26,7 @@ func (s *server) RepositoryExists(ctx context.Context, in *gitalypb.RepositoryEx } func (s *server) HasLocalBranches(ctx context.Context, in *gitalypb.HasLocalBranchesRequest) (*gitalypb.HasLocalBranchesResponse, error) { - args := []string{"for-each-ref", "--count=1", "refs/heads"} - cmd, err := git.Command(ctx, in.GetRepository(), args...) + cmd, err := git.SafeCmd(ctx, in.GetRepository(), nil, git.SubCmd{Name: "for-each-ref", Flags: []git.Option{git.Flag{Name: "--count=1"}}, Args: []string{"refs/heads"}}) if err != nil { if _, ok := status.FromError(err); ok { return nil, err |