aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/pull.go26
1 files changed, 24 insertions, 2 deletions
diff --git a/commands/pull.go b/commands/pull.go
index e9f0ad3e..ea064d99 100644
--- a/commands/pull.go
+++ b/commands/pull.go
@@ -2,8 +2,9 @@ package commands
import (
"errors"
- "os"
+ "fmt"
+ "github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/cache"
"github.com/spf13/cobra"
)
@@ -24,7 +25,28 @@ func runPull(cmd *cobra.Command, args []string) error {
}
defer backend.Close()
- return backend.Pull(remote, os.Stdout)
+ fmt.Println("Fetching remote ...")
+
+ stdout, err := backend.Fetch(remote)
+ if err != nil {
+ return err
+ }
+
+ fmt.Println(stdout)
+
+ fmt.Println("Merging data ...")
+
+ for merge := range backend.MergeAll(remote) {
+ if merge.Err != nil {
+ return merge.Err
+ }
+
+ if merge.Status != bug.MsgMergeNothing {
+ fmt.Printf("%s: %s\n", merge.HumanId, merge.Status)
+ }
+ }
+
+ return nil
}
// showCmd defines the "push" subcommand.