- write_in_full(helper->in, "fetch ", 6);
- write_in_full(helper->in, sha1_to_hex(posn->old_sha1), 40);
- write_in_full(helper->in, " ", 1);
- write_in_full(helper->in, posn->name, strlen(posn->name));
- write_in_full(helper->in, "\n", 1);
+
+ strbuf_addf(&buf, "fetch %s %s\n",
+ sha1_to_hex(posn->old_sha1), posn->name);
+ write_in_full(helper->in, buf.buf, buf.len);
+ strbuf_reset(&buf);
+