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

Method Pull

cache/repo_cache_common.go:138–154  ·  view source on GitHub ↗

Pull will do a Fetch + MergeAll This function will return an error if a merge fail

(remote string)

Source from the content-addressed store, hash-verified

136// Pull will do a Fetch + MergeAll
137// This function will return an error if a merge fail
138func (c *RepoCache) Pull(remote string) error {
139 _, err := c.Fetch(remote)
140 if err != nil {
141 return err
142 }
143
144 for merge := range c.MergeAll(remote) {
145 if merge.Err != nil {
146 return merge.Err
147 }
148 if merge.Status == entity.MergeStatusInvalid {
149 return errors.Errorf("merge failure: %s", merge.Reason)
150 }
151 }
152
153 return nil
154}
155
156func (c *RepoCache) SetUserIdentity(i *IdentityCache) error {
157 c.muUserIdentity.RLock()

Callers 1

TestCachePushPullFunction · 0.80

Calls 3

FetchMethod · 0.95
MergeAllMethod · 0.95
ErrorfMethod · 0.80

Tested by 1

TestCachePushPullFunction · 0.64