MCPcopy Create free account
hub / github.com/git-bug/git-bug / Pull

Function Pull

entity/dag/entity_actions.go:35–51  ·  view source on GitHub ↗

Pull will do a Fetch + MergeAll Contrary to MergeAll, this function will return an error if a merge fail.

(def Definition, wrapper func(e *Entity) EntityT, repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, author identity.Interface)

Source from the content-addressed store, hash-verified

33// Pull will do a Fetch + MergeAll
34// Contrary to MergeAll, this function will return an error if a merge fail.
35func Pull[EntityT entity.Interface](def Definition, wrapper func(e *Entity) EntityT, repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, author identity.Interface) error {
36 _, err := Fetch(def, repo, remote)
37 if err != nil {
38 return err
39 }
40
41 for merge := range MergeAll(def, wrapper, repo, resolvers, remote, author) {
42 if merge.Err != nil {
43 return merge.Err
44 }
45 if merge.Status == entity.MergeStatusInvalid {
46 return errors.Errorf("merge failure: %s", merge.Reason)
47 }
48 }
49
50 return nil
51}
52
53// MergeAll will merge all the available remote Entity:
54//

Callers 4

PullFunction · 0.92
Example_entityFunction · 0.92
TestEntityPushPullFunction · 0.70
TestListLocalIdsFunction · 0.70

Calls 3

ErrorfMethod · 0.80
FetchFunction · 0.70
MergeAllFunction · 0.70

Tested by 3

Example_entityFunction · 0.74
TestEntityPushPullFunction · 0.56
TestListLocalIdsFunction · 0.56