MCPcopy Index your code
hub / github.com/go-git/go-git / Commit

Method Commit

storage/transactional/object.go:74–84  ·  view source on GitHub ↗

Commit it copies the objects of the temporal storage into the base storage.

()

Source from the content-addressed store, hash-verified

72
73// Commit it copies the objects of the temporal storage into the base storage.
74func (o *ObjectStorage) Commit() error {
75 iter, err := o.temporal.IterEncodedObjects(plumbing.AnyObject)
76 if err != nil {
77 return err
78 }
79
80 return iter.ForEach(func(obj plumbing.EncodedObject) error {
81 _, err := o.EncodedObjectStorer.SetEncodedObject(obj)
82 return err
83 })
84}
85
86func (o *ObjectStorage) AddAlternate(remote string) error {
87 return o.temporal.AddAlternate(remote)

Callers 1

TestCommitMethod · 0.95

Calls 3

IterEncodedObjectsMethod · 0.65
ForEachMethod · 0.65
SetEncodedObjectMethod · 0.65

Tested by 1

TestCommitMethod · 0.76