MCPcopy Create free account
hub / github.com/go-git/go-git / getPatchContext

Function getPatchContext

plumbing/object/patch.go:29–47  ·  view source on GitHub ↗
(ctx context.Context, message string, changes ...*Change)

Source from the content-addressed store, hash-verified

27}
28
29func getPatchContext(ctx context.Context, message string, changes ...*Change) (*Patch, error) {
30 var filePatches []fdiff.FilePatch
31 for _, c := range changes {
32 select {
33 case <-ctx.Done():
34 return nil, ErrCanceled
35 default:
36 }
37
38 fp, err := filePatchWithContext(ctx, c)
39 if err != nil {
40 return nil, err
41 }
42
43 filePatches = append(filePatches, fp)
44 }
45
46 return &Patch{message, filePatches}, nil
47}
48
49func filePatchWithContext(ctx context.Context, c *Change) (fdiff.FilePatch, error) {
50 from, to, err := c.Files()

Callers 3

getPatchFunction · 0.85
PatchContextMethod · 0.85
PatchContextMethod · 0.85

Calls 1

filePatchWithContextFunction · 0.85

Tested by

no test coverage detected