Skip to content

Commit

Permalink
Remove --storage option for clone and rcs init
Browse files Browse the repository at this point in the history
The "fs" backend was filtered out of the list of valid values for the
`--storage` option on these commands.  The only remaining option would
be "gitfs", so there is no need for an option.
  • Loading branch information
kpitt committed Sep 27, 2022
1 parent 35242af commit ac58b3d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
4 changes: 0 additions & 4 deletions internal/action/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func (s *Action) Clone(c *cli.Context) error {
ctx = backend.WithCryptoBackendString(ctx, c.String("crypto"))
}

if c.IsSet("storage") {
ctx = backend.WithStorageBackendString(ctx, c.String("storage"))
}

path := c.String("path")

if c.Args().Len() < 1 {
Expand Down
10 changes: 0 additions & 10 deletions internal/action/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

"github.com/kpitt/gopass/internal/backend"
"github.com/kpitt/gopass/internal/set"
"github.com/kpitt/gopass/pkg/debug"
"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -143,10 +142,6 @@ func (s *Action) GetCommands() []*cli.Command {
Name: "crypto",
Usage: fmt.Sprintf("Select crypto backend %v", backend.CryptoRegistry.BackendNames()),
},
&cli.StringFlag{
Name: "storage",
Usage: fmt.Sprintf("Select storage backend %v", set.Filter(backend.StorageRegistry.BackendNames(), "fs")),
},
&cli.BoolFlag{
Name: "check-keys",
Usage: "Check for valid decryption keys. Generate new keys if none are found.",
Expand Down Expand Up @@ -740,11 +735,6 @@ func (s *Action) GetCommands() []*cli.Command {
Aliases: []string{"useremail"},
Usage: "Git Author Email",
},
&cli.StringFlag{
Name: "storage",
Usage: fmt.Sprintf("Select storage backend %v", set.Filter(backend.StorageRegistry.BackendNames(), "fs")),
Value: "gitfs",
},
},
},
{
Expand Down
7 changes: 3 additions & 4 deletions internal/action/rcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ func (s *Action) RCSInit(c *cli.Context) error {
store := c.String("store")
un := termio.DetectName(c.Context, c)
ue := termio.DetectEmail(c.Context, c)
ctx = backend.WithStorageBackendString(ctx, c.String("storage"))

// default to git.
if !backend.HasStorageBackend(ctx) {
ctx = backend.WithStorageBackend(ctx, backend.GitFS)
}

if err := s.rcsInit(ctx, store, un, ue); err != nil {
return exit.Error(exit.Git, err, "failed to initialize %s: %s", backend.StorageBackendName(backend.GetStorageBackend(ctx)), err)
return exit.Error(exit.Git, err, "failed to initialize git: %s", err)
}

return nil
Expand All @@ -58,10 +57,10 @@ func (s *Action) rcsInit(ctx context.Context, store, un, ue string) error {
out.Printf(ctx, "Git initialization failed. You may want to try to 'export GPG_TTY=$(tty)' and start over.")
}

return fmt.Errorf("failed to run RCS init: %w", err)
return fmt.Errorf("failed to run git init: %w", err)
}

out.Printf(ctx, "Initialized %s repository (%s) for %s / %s...", be, bn, un, ue)
out.Printf(ctx, "Initialized git repository for %q <%s>...", un, ue)

return nil
}
Expand Down

0 comments on commit ac58b3d

Please sign in to comment.