@@ -22,6 +22,7 @@
#include "refs.h"
#include "pager.h"
#include "log.h"
+#include "streaming.h"
#include "run-command.h"
#include "parse-options.h"
#include "string-list.h"
@@ -149,18 +150,6 @@ static int list_each_note(const struct object_id *object_oid,
return 0;
}
-static void copy_obj_to_fd(int fd, const struct object_id *oid)
-{
- unsigned long size;
- enum object_type type;
- char *buf = repo_read_object_file(the_repository, oid, &type, &size);
- if (buf) {
- if (size)
- write_or_die(fd, buf, size);
- free(buf);
- }
-}
-
static void write_commented_object(int fd, const struct object_id *object)
{
struct child_process show = CHILD_PROCESS_INIT;
@@ -205,7 +194,7 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
if (d->given)
write_or_die(fd, d->buf.buf, d->buf.len);
else if (old_note)
- copy_obj_to_fd(fd, old_note);
+ stream_blob_to_fd(fd, old_note, NULL, 0);
strbuf_addch(&buf, '\n');
strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_char);