aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug_actions.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/bug_actions.go')
-rw-r--r--bug/bug_actions.go26
1 files changed, 5 insertions, 21 deletions
diff --git a/bug/bug_actions.go b/bug/bug_actions.go
index f9e6d0c6..37c3aa05 100644
--- a/bug/bug_actions.go
+++ b/bug/bug_actions.go
@@ -2,8 +2,6 @@ package bug
import (
"fmt"
- "io"
- "io/ioutil"
"strings"
"github.com/MichaelMure/git-bug/repository"
@@ -28,33 +26,19 @@ func Push(repo repository.Repo, remote string) (string, error) {
return repo.PushRefs(remote, bugsRefPattern+"*")
}
-// Pull does a Fetch and merge the updates into the local bug states
-func Pull(repo repository.Repo, out io.Writer, remote string) error {
- // TODO: return a chan of changes for the cache to be updated properly
-
- if out == nil {
- out = ioutil.Discard
- }
-
- fmt.Fprintf(out, "Fetching remote ...\n")
-
- stdout, err := Fetch(repo, remote)
+// Pull will do a Fetch + MergeAll
+// This function won't give details on the underlying process. If you need more
+// use Fetch and MergeAll separately.
+func Pull(repo repository.Repo, remote string) error {
+ _, err := Fetch(repo, remote)
if err != nil {
return err
}
- out.Write([]byte(stdout))
-
- fmt.Fprintf(out, "Merging data ...\n")
-
for merge := range MergeAll(repo, remote) {
if merge.Err != nil {
return merge.Err
}
-
- if merge.Status != MsgMergeNothing {
- fmt.Fprintf(out, "%s: %s\n", merge.HumanId, merge.Status)
- }
}
return nil