aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-02 15:37:28 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-02 15:37:28 +0200
commit6ff02ed84254275f2d19569a1a5f14efc1d47f31 (patch)
treec6e685156ee22e6f7aee76190ea6d6c391b3899e /bug
parent150b5d489c8573fe9214c11defbeeddedde48e16 (diff)
downloadgit-bug-6ff02ed84254275f2d19569a1a5f14efc1d47f31.tar.gz
add some documentation
Diffstat (limited to 'bug')
-rw-r--r--bug/bug_actions.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/bug/bug_actions.go b/bug/bug_actions.go
index 31e9c07d..f9e6d0c6 100644
--- a/bug/bug_actions.go
+++ b/bug/bug_actions.go
@@ -14,6 +14,8 @@ const MsgMergeInvalid = "invalid data"
const MsgMergeUpdated = "updated"
const MsgMergeNothing = "nothing to do"
+// Fetch retrieve update from a remote
+// This does not change the local bugs state
func Fetch(repo repository.Repo, remote string) (string, error) {
remoteRefSpec := fmt.Sprintf(bugsRemoteRefPattern, remote)
fetchRefSpec := fmt.Sprintf("%s*:%s*", bugsRefPattern, remoteRefSpec)
@@ -21,12 +23,15 @@ func Fetch(repo repository.Repo, remote string) (string, error) {
return repo.FetchRefs(remote, fetchRefSpec)
}
+// Push update a remote with the local changes
func Push(repo repository.Repo, remote string) (string, error) {
return repo.PushRefs(remote, bugsRefPattern+"*")
}
-// TODO: return a chan of changes for the cache to be updated properly
+// 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
}