From 7397c94d993541b33e555b758ebdb8f61ff33c6c Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Fri, 31 Aug 2018 13:18:03 +0200 Subject: make CLI commands use the cache to lock the repo properly --- commands/push.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'commands/push.go') diff --git a/commands/push.go b/commands/push.go index 86c37b46..06a4044b 100644 --- a/commands/push.go +++ b/commands/push.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/MichaelMure/git-bug/bug" + "github.com/MichaelMure/git-bug/cache" "github.com/spf13/cobra" ) @@ -18,7 +18,13 @@ func runPush(cmd *cobra.Command, args []string) error { remote = args[0] } - stdout, err := bug.Push(repo, remote) + backend, err := cache.NewRepoCache(repo) + if err != nil { + return err + } + defer backend.Close() + + stdout, err := backend.Push(remote) if err != nil { return err } -- cgit