Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Properly propagate RCS backend on gopass clone (gopasspw#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikschulz authored May 31, 2018
1 parent 71f9ad6 commit 1a4ca33
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/action/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 1a4ca33

Please sign in to comment.