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-11-12 14:45:26 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2019-11-12 14:45:26 +0300
commitf799262dd634130bc3840da7c20f63ffcd1c9273 (patch)
tree64c480938180d3dae225b0faa8ef917e5bf7ba3a
parentfb4df98cb00fa5f9fafa51c03f055f1d0d14c74c (diff)
Apply GitDSL for archive.go
Closes: https://gitlab.com/gitlab-org/gitaly/issues/1982
-rw-r--r--internal/service/repository/archive.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/service/repository/archive.go b/internal/service/repository/archive.go
index 0f491ea3e..3b4ca3630 100644
--- a/internal/service/repository/archive.go
+++ b/internal/service/repository/archive.go
@@ -97,9 +97,12 @@ func validateGetArchivePrecondition(ctx context.Context, in *gitalypb.GetArchive
}
func handleArchive(ctx context.Context, writer io.Writer, in *gitalypb.GetArchiveRequest, compressCmd *exec.Cmd, format string, path string) error {
- archiveCommand, err := git.Command(ctx, in.GetRepository(), "archive",
- "--format="+format, "--prefix="+in.GetPrefix()+"/", in.GetCommitId(), "--", path)
-
+ archiveCommand, err := git.SafeCmd(ctx, in.GetRepository(), nil, git.SubCmd{
+ Name: "archive",
+ Flags: []git.Option{git.ValueFlag{"--format", format}, git.ValueFlag{"--prefix", in.GetPrefix() + "/"}},
+ Args: []string{in.GetCommitId()},
+ PostSepArgs: []string{path},
+ })
if err != nil {
return err
}