Skip to content

Commit e992d1e

Browse files
rscharfegitster
authored andcommitted
use strbuf_addbuf for adding strbufs
Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 81e776d commit e992d1e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name)
861861
read_branch_desc(&desc, branch_name);
862862
if (desc.len) {
863863
strbuf_addch(buf, '\n');
864-
strbuf_add(buf, desc.buf, desc.len);
864+
strbuf_addbuf(buf, &desc);
865865
strbuf_addch(buf, '\n');
866866
}
867867
}

pretty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
13761376
case trunc_none:
13771377
break;
13781378
}
1379-
strbuf_addstr(sb, local_sb.buf);
1379+
strbuf_addbuf(sb, &local_sb);
13801380
} else {
13811381
int sb_len = sb->len, offset = 0;
13821382
if (c->flush_type == flush_left)

rerere.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ static int handle_path(unsigned char *sha1, struct rerere_io *io, int marker_siz
207207
strbuf_reset(&one);
208208
strbuf_reset(&two);
209209
} else if (hunk == RR_SIDE_1)
210-
strbuf_addstr(&one, buf.buf);
210+
strbuf_addbuf(&one, &buf);
211211
else if (hunk == RR_ORIGINAL)
212212
; /* discard */
213213
else if (hunk == RR_SIDE_2)
214-
strbuf_addstr(&two, buf.buf);
214+
strbuf_addbuf(&two, &buf);
215215
else
216216
rerere_io_putstr(buf.buf, io);
217217
continue;

sha1_name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ static int interpret_nth_prior_checkout(const char *name, int namelen,
946946
retval = 0;
947947
if (0 < for_each_reflog_ent_reverse("HEAD", grab_nth_branch_switch, &cb)) {
948948
strbuf_reset(buf);
949-
strbuf_add(buf, cb.buf.buf, cb.buf.len);
949+
strbuf_addbuf(buf, &cb.buf);
950950
retval = brace - name + 1;
951951
}
952952

0 commit comments

Comments
 (0)