diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-31 13:18:03 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-31 17:22:10 +0200 |
commit | 7397c94d993541b33e555b758ebdb8f61ff33c6c (patch) | |
tree | dbdc52bb6efa03791e5ca84bc8695da5103524d2 /commands/pull.go | |
parent | 116a94401f0d3fbf79f7e20716b1c7b739e33246 (diff) | |
download | git-bug-7397c94d993541b33e555b758ebdb8f61ff33c6c.tar.gz git-bug-7397c94d993541b33e555b758ebdb8f61ff33c6c.zip |
make CLI commands use the cache to lock the repo properly
Diffstat (limited to 'commands/pull.go')
-rw-r--r-- | commands/pull.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/commands/pull.go b/commands/pull.go index ff07912a..e9f0ad3e 100644 --- a/commands/pull.go +++ b/commands/pull.go @@ -4,7 +4,7 @@ import ( "errors" "os" - "github.com/MichaelMure/git-bug/bug" + "github.com/MichaelMure/git-bug/cache" "github.com/spf13/cobra" ) @@ -18,7 +18,13 @@ func runPull(cmd *cobra.Command, args []string) error { remote = args[0] } - return bug.Pull(repo, os.Stdout, remote) + backend, err := cache.NewRepoCache(repo) + if err != nil { + return err + } + defer backend.Close() + + return backend.Pull(remote, os.Stdout) } // showCmd defines the "push" subcommand. |