Pull will do a Fetch + MergeAll This function will return an error if a merge fail
(remote string)
| 136 | // Pull will do a Fetch + MergeAll |
| 137 | // This function will return an error if a merge fail |
| 138 | func (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 | |
| 156 | func (c *RepoCache) SetUserIdentity(i *IdentityCache) error { |
| 157 | c.muUserIdentity.RLock() |