diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-25 18:01:32 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-25 18:01:32 +0200 |
commit | 6a12373965aff9f80147f8b5bff6a5a104927365 (patch) | |
tree | ccc1e34fba059512acab39286a86f6b73c5ad318 /commands/pull.go | |
parent | 49c90eab26875cbf3094d9a546ad29b426e174a1 (diff) | |
download | git-bug-6a12373965aff9f80147f8b5bff6a5a104927365.tar.gz |
more refactoring to have reusable bug action across different UI
Diffstat (limited to 'commands/pull.go')
-rw-r--r-- | commands/pull.go | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/commands/pull.go b/commands/pull.go index ac6a3732..52b3ecd8 100644 --- a/commands/pull.go +++ b/commands/pull.go @@ -2,9 +2,9 @@ package commands import ( "errors" - "fmt" "github.com/MichaelMure/git-bug/bug" "github.com/spf13/cobra" + "os" ) func runPull(cmd *cobra.Command, args []string) error { @@ -17,25 +17,7 @@ func runPull(cmd *cobra.Command, args []string) error { remote = args[0] } - fmt.Printf("Fetching remote ...\n\n") - - if err := bug.Fetch(repo, remote); err != nil { - return err - } - - fmt.Printf("\nMerging data ...\n\n") - - for merge := range bug.MergeAll(repo, remote) { - if merge.Err != nil { - return merge.Err - } - - if merge.Status != bug.MsgNothing { - fmt.Printf("%s: %s\n", merge.HumanId, merge.Status) - } - } - - return nil + return bug.Pull(repo, os.Stdout, remote) } // showCmd defines the "push" subcommand. |