It was building up the full content of the export stream in memory before writing any of it. Now it streams it to standard output.
4ROXGUTY2IM5NTYAS5XANJAQH3Z6375RVGZAS776ISEP7I23YTHQC
if _, err := fmt.Fprintf(w, "mark :%d\n", c.Mark); err != nil {
return err
}
}
if _, err := fmt.Fprintln(w, "committer", c.Committer, formatTime(c.Timestamp)); err != nil {
return err
}
if _, err := fmt.Fprintln(w, "data", len(c.Message)); err != nil {
return err
}
if _, err := fmt.Fprintln(w, c.Message); err != nil {
return err
fmt.Printf("mark :%d\n", c.Mark)
if _, err := fmt.Fprintln(w, "data", len(b.Data)); err != nil {
return err
}
if _, err := w.Write(b.Data); err != nil {
return err
}
if _, err := fmt.Fprintln(w); err != nil {
return err
}
return nil
fmt.Println("data", len(b.Data))
os.Stdout.Write(b.Data)
fmt.Println()
f.Commits = append(f.Commits, c)
}
func (f *FastExportStream) ReverseCommits() {
for i, j := 0, len(f.Commits)-1; j > i; i, j = i+1, j-1 {
f.Commits[i], f.Commits[j] = f.Commits[j], f.Commits[i]
}
}
func (f *FastExportStream) WriteTo(w io.Writer) error {
for _, b := range f.Blobs {
if err := b.WriteTo(w); err != nil {
return err
}
}
for _, c := range f.Commits {
if err := c.WriteTo(w); err != nil {
return err
}
}
return nil
c.write()