(ctx context.Context, w io.Writer, lower []mount.Mount, upperRoot string)
| 42 | ) |
| 43 | |
| 44 | func writeDiff(ctx context.Context, w io.Writer, lower []mount.Mount, upperRoot string) error { |
| 45 | var opts []archive.ChangeWriterOpt |
| 46 | |
| 47 | return mount.WithTempMount(ctx, lower, func(lowerRoot string) error { |
| 48 | cw := archive.NewChangeWriter(w, upperRoot, opts...) |
| 49 | err := fs.DiffDirChanges(ctx, lowerRoot, upperRoot, fs.DiffSourceOverlayFS, cw.HandleChange) |
| 50 | if err != nil { |
| 51 | return fmt.Errorf("failed to create diff tar stream: %w", err) |
| 52 | } |
| 53 | return cw.Close() |
| 54 | }) |
| 55 | } |
| 56 | |
| 57 | // Compare creates a diff between the given mounts and uploads the result |
| 58 | // to the content store. |
no test coverage detected
searching dependent graphs…