From 1a4ca337f71717f0b34bb6bdcc7768ae449ddfc4 Mon Sep 17 00:00:00 2001 From: Dominik Schulz Date: Thu, 31 May 2018 11:47:15 +0200 Subject: [PATCH] Properly propagate RCS backend on gopass clone (#820) Fixes #750 --- pkg/action/clone.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/action/clone.go b/pkg/action/clone.go index 68a3cf462d..d9860adcc9 100644 --- a/pkg/action/clone.go +++ b/pkg/action/clone.go @@ -20,8 +20,12 @@ import ( // Clone will fetch and mount a new password store from a git repo func (s *Action) Clone(ctx context.Context, c *cli.Context) error { - ctx = backend.WithCryptoBackendString(ctx, c.String("crypto")) - ctx = backend.WithRCSBackendString(ctx, c.String("sync")) + if c.IsSet("crypto") { + ctx = backend.WithCryptoBackendString(ctx, c.String("crypto")) + } + if c.IsSet("sync") { + ctx = backend.WithRCSBackendString(ctx, c.String("sync")) + } if len(c.Args()) < 1 { return ExitError(ctx, ExitUsage, nil, "Usage: %s clone repo [mount]", s.Name) @@ -55,6 +59,7 @@ func (s *Action) clone(ctx context.Context, repo, mount, path string) error { case backend.GitCLI: fallthrough default: + ctx = backend.WithRCSBackend(ctx, backend.GitCLI) if _, err := gitcli.Clone(ctx, repo, path); err != nil { return ExitError(ctx, ExitGit, err, "failed to clone repo '%s' to '%s'", repo, path) }