Skip to content

Commit b3d3036

Browse files
committed
Fix unconditional error in zbstore.Export for empty path set
1 parent a352120 commit b3d3036

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

zbstore/export.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ type ExportOptions struct {
5454
// and serialize them to dst.
5555
func Export(ctx context.Context, store Store, dst io.Writer, paths sets.Set[Path], opts *ExportOptions) error {
5656
if len(paths) == 0 {
57-
_, err := io.WriteString(dst, exportEOFMarker)
58-
return newExportError(slices.Sorted(paths.All()), err)
57+
if _, err := io.WriteString(dst, exportEOFMarker); err != nil {
58+
return newExportError(nil, err)
59+
}
60+
return nil
5961
}
6062
if e, ok := store.(Exporter); ok {
6163
return e.StoreExport(ctx, dst, paths, opts)

0 commit comments

Comments
 (0)