board_actions.go

 1package board
 2
 3import (
 4	"github.com/git-bug/git-bug/entities/identity"
 5	"github.com/git-bug/git-bug/entity"
 6	"github.com/git-bug/git-bug/entity/dag"
 7	"github.com/git-bug/git-bug/repository"
 8)
 9
10// Fetch retrieve updates from a remote
11// This does not change the local board state
12func Fetch(repo repository.Repo, remote string) (string, error) {
13	return dag.Fetch(def, repo, remote)
14}
15
16// Push update a remote with the local changes
17func Push(repo repository.Repo, remote string) (string, error) {
18	return dag.Push(def, repo, remote)
19}
20
21// Pull will do a Fetch + MergeAll
22// This function will return an error if a merge fail
23// Note: an author is necessary for the case where a merge commit is created, as this commit will
24// have an author and may be signed if a signing key is available.
25func Pull(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor identity.Interface) error {
26	return dag.Pull(def, wrapper, repo, resolvers, remote, mergeAuthor)
27}
28
29// MergeAll will merge all the available remote board
30// Note: an author is necessary for the case where a merge commit is created, as this commit will
31// have an author and may be signed if a signing key is available.
32func MergeAll(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor identity.Interface) <-chan entity.MergeResult {
33	return dag.MergeAll(def, wrapper, repo, resolvers, remote, mergeAuthor)
34}
35
36// Remove will remove a local bug from its entity.Id
37func Remove(repo repository.ClockedRepo, id entity.Id) error {
38	return dag.Remove(def, repo, id)
39}