diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-12 21:09:30 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-12 21:09:30 +0200 |
commit | e2f4b027c946831c3f4f119d87a80513c7cf8fdc (patch) | |
tree | b2ec57c89c49062ab2e8adeacb2646d2f152db80 /cache/cache.go | |
parent | 721ed3248e8bf167a89df14d9fc2bf5b0fe45753 (diff) | |
download | git-bug-e2f4b027c946831c3f4f119d87a80513c7cf8fdc.tar.gz |
termui: implement push/pull
Diffstat (limited to 'cache/cache.go')
-rw-r--r-- | cache/cache.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cache/cache.go b/cache/cache.go index da0a2681..c4177f75 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -2,6 +2,7 @@ package cache import ( "fmt" + "io" "strings" "github.com/MichaelMure/git-bug/bug" @@ -28,6 +29,10 @@ type RepoCacher interface { // Mutations NewBug(title string, message string) (BugCacher, error) NewBugWithFiles(title string, message string, files []util.Hash) (BugCacher, error) + Fetch(remote string) (string, error) + MergeAll(remote string) <-chan bug.MergeResult + Pull(remote string, out io.Writer) error + Push(remote string) (string, error) } type BugCacher interface { @@ -188,6 +193,22 @@ func (c *RepoCache) NewBugWithFiles(title string, message string, files []util.H return cached, nil } +func (c *RepoCache) Fetch(remote string) (string, error) { + return bug.Fetch(c.repo, remote) +} + +func (c *RepoCache) MergeAll(remote string) <-chan bug.MergeResult { + return bug.MergeAll(c.repo, remote) +} + +func (c *RepoCache) Pull(remote string, out io.Writer) error { + return bug.Pull(c.repo, out, remote) +} + +func (c *RepoCache) Push(remote string) (string, error) { + return bug.Push(c.repo, remote) +} + // Bug ------------------------ type BugCache struct { |