X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=commit.c;h=632061c2c3669991b6526a5b6b452e3b54ee718c;hb=5e2f779cbf60997809130fde213736e1ea4f6f33;hp=6393e1b36218e5f8970b0c43092b07f5d94b0bce;hpb=c6b53c8684966b3e22d0f26dc981a8b4a0b03ce7;p=git.git diff --git a/commit.c b/commit.c index 6393e1b36..632061c2c 100644 --- a/commit.c +++ b/commit.c @@ -5,6 +5,7 @@ #include "utf8.h" #include "diff.h" #include "revision.h" +#include "notes.h" int save_commit_buffer = 1; @@ -199,7 +200,7 @@ struct commit_graft *lookup_commit_graft(const unsigned char *sha1) return commit_graft[pos]; } -int write_shallow_commits(int fd, int use_pack_protocol) +int write_shallow_commits(struct strbuf *out, int use_pack_protocol) { int i, count = 0; for (i = 0; i < commit_graft_nr; i++) @@ -208,12 +209,10 @@ int write_shallow_commits(int fd, int use_pack_protocol) sha1_to_hex(commit_graft[i]->sha1); count++; if (use_pack_protocol) - packet_write(fd, "shallow %s", hex); + packet_buf_write(out, "shallow %s", hex); else { - if (write_in_full(fd, hex, 40) != 40) - break; - if (write_str_in_full(fd, "\n") != 1) - break; + strbuf_addstr(out, hex); + strbuf_addch(out, '\n'); } } return count;