MCPcopy Index your code
hub / github.com/git-bug/git-bug / MergeAll

Method MergeAll

cache/repo_cache_common.go:95–123  ·  view source on GitHub ↗

MergeAll will merge all the available remote bug and identities

(remote string)

Source from the content-addressed store, hash-verified

93
94// MergeAll will merge all the available remote bug and identities
95func (c *RepoCache) MergeAll(remote string) <-chan entity.MergeResult {
96 out := make(chan entity.MergeResult)
97
98 dependency := [][]cacheMgmt{
99 {c.identities},
100 {c.bugs},
101 }
102
103 // run MergeAll according to entities dependencies and merge the results
104 go func() {
105 defer close(out)
106
107 for _, subcaches := range dependency {
108 var wg sync.WaitGroup
109 for _, subcache := range subcaches {
110 wg.Add(1)
111 go func(subcache cacheMgmt) {
112 for res := range subcache.MergeAll(remote) {
113 out <- res
114 }
115 wg.Done()
116 }(subcache)
117 }
118 wg.Wait()
119 }
120 }()
121
122 return out
123}
124
125// Push update a remote with the local changes
126func (c *RepoCache) Push(remote string) (string, error) {

Callers 1

PullMethod · 0.95

Calls 4

closeFunction · 0.85
AddMethod · 0.80
WaitMethod · 0.80
MergeAllMethod · 0.65

Tested by

no test coverage detected