use strbuf_addbuf for adding strbufs

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2014-07-10 10:52:21 +02:00 committed by Junio C Hamano
parent 81e776d92b
commit e992d1eb39
4 changed files with 5 additions and 5 deletions

View file

@ -861,7 +861,7 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name)
read_branch_desc(&desc, branch_name);
if (desc.len) {
strbuf_addch(buf, '\n');
strbuf_add(buf, desc.buf, desc.len);
strbuf_addbuf(buf, &desc);
strbuf_addch(buf, '\n');
}
}

View file

@ -1376,7 +1376,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
case trunc_none:
break;
}
strbuf_addstr(sb, local_sb.buf);
strbuf_addbuf(sb, &local_sb);
} else {
int sb_len = sb->len, offset = 0;
if (c->flush_type == flush_left)

View file

@ -207,11 +207,11 @@ static int handle_path(unsigned char *sha1, struct rerere_io *io, int marker_siz
strbuf_reset(&one);
strbuf_reset(&two);
} else if (hunk == RR_SIDE_1)
strbuf_addstr(&one, buf.buf);
strbuf_addbuf(&one, &buf);
else if (hunk == RR_ORIGINAL)
; /* discard */
else if (hunk == RR_SIDE_2)
strbuf_addstr(&two, buf.buf);
strbuf_addbuf(&two, &buf);
else
rerere_io_putstr(buf.buf, io);
continue;

View file

@ -946,7 +946,7 @@ static int interpret_nth_prior_checkout(const char *name, int namelen,
retval = 0;
if (0 < for_each_reflog_ent_reverse("HEAD", grab_nth_branch_switch, &cb)) {
strbuf_reset(buf);
strbuf_add(buf, cb.buf.buf, cb.buf.len);
strbuf_addbuf(buf, &cb.buf);
retval = brace - name + 1;
}