aboutsummaryrefslogtreecommitdiffstats
path: root/commands/push.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-31 13:18:03 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-31 17:22:10 +0200
commit7397c94d993541b33e555b758ebdb8f61ff33c6c (patch)
treedbdc52bb6efa03791e5ca84bc8695da5103524d2 /commands/push.go
parent116a94401f0d3fbf79f7e20716b1c7b739e33246 (diff)
downloadgit-bug-7397c94d993541b33e555b758ebdb8f61ff33c6c.tar.gz
make CLI commands use the cache to lock the repo properly
Diffstat (limited to 'commands/push.go')
-rw-r--r--commands/push.go10
1 files changed, 8 insertions, 2 deletions
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
}