Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2019-10-07 15:02:07 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2019-10-07 15:02:07 +0300
commit7c545e12fc7a23c300cf5f3b4c5800fbf2d53d4e (patch)
treedcee1f36108e4043204a8df4eefc62dbcea7fd09
parenta5ca2426be195b74bf9cb8d9cccd2ca7681931cd (diff)
Use git.SafeCmd for numstats of diffs
Closes: https://gitlab.com/gitlab-org/gitaly/issues/1961
-rw-r--r--internal/service/diff/numstat.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/service/diff/numstat.go b/internal/service/diff/numstat.go
index 38f7de5a7..d843090b3 100644
--- a/internal/service/diff/numstat.go
+++ b/internal/service/diff/numstat.go
@@ -21,8 +21,11 @@ func (s *server) DiffStats(in *gitalypb.DiffStatsRequest, stream gitalypb.DiffSe
}
var batch []*gitalypb.DiffStats
- cmdArgs := []string{"diff", "--numstat", "-z", in.LeftCommitId, in.RightCommitId}
- cmd, err := git.Command(stream.Context(), in.Repository, cmdArgs...)
+ cmd, err := git.SafeCmd(stream.Context(), in.Repository, nil, git.SubCmd{
+ Name: "diff",
+ Flags: []git.Option{git.Flag{"--numstat"}, git.Flag{"-z"}},
+ Args: []string{in.LeftCommitId, in.RightCommitId},
+ })
if err != nil {
if _, ok := status.FromError(err); ok {