(ctx context.Context, message string, changes ...*Change)
| 27 | } |
| 28 | |
| 29 | func 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 | |
| 49 | func filePatchWithContext(ctx context.Context, c *Change) (fdiff.FilePatch, error) { |
| 50 | from, to, err := c.Files() |
no test coverage detected