@@ -454,7 +454,7 @@ static int register_ref(const char *refname, const char *referent UNUSED, const
{
struct strbuf good_prefix = STRBUF_INIT;
strbuf_addstr(&good_prefix, term_good);
- strbuf_addstr(&good_prefix, "-");
+ strbuf_addch(&good_prefix, '-');
if (!strcmp(refname, term_bad)) {
free(current_bad_oid);
@@ -37,7 +37,7 @@ static void expand_objectsize(struct strbuf *line, const struct object_id *oid,
} else if (padded) {
strbuf_addf(line, "%7s", "-");
} else {
- strbuf_addstr(line, "-");
+ strbuf_addch(line, '-');
}
}
@@ -337,7 +337,7 @@ static void trace_encoding(const char *context, const char *path,
((i+1) % 8 && (i+1) < len ? ' ' : '\n')
);
}
- strbuf_addchars(&trace, '\n', 1);
+ strbuf_addch(&trace, '\n');
trace_strbuf(&coe, &trace);
strbuf_release(&trace);
@@ -1763,7 +1763,7 @@ static void add_line_count(struct strbuf *out, int count)
strbuf_addstr(out, "0,0");
break;
case 1:
- strbuf_addstr(out, "1");
+ strbuf_addch(out, '1');
break;
default:
strbuf_addf(out, "1,%d", count);
@@ -452,7 +452,7 @@ void fmt_output_subject(struct strbuf *filename,
strbuf_addf(&temp, "v%s", info->reroll_count);
format_sanitized_subject(filename, temp.buf, temp.len);
- strbuf_addstr(filename, "-");
+ strbuf_addch(filename, '-');
strbuf_release(&temp);
}
strbuf_addf(filename, "%04d-%s", nr, subject);
@@ -827,7 +827,7 @@ static void path_msg(struct merge_options *opt,
va_start(ap, fmt);
if (opt->priv->call_depth) {
- strbuf_addchars(dest, ' ', 2);
+ strbuf_addstr(dest, " ");
strbuf_addstr(dest, "From inner merge:");
strbuf_addchars(dest, ' ', opt->priv->call_depth * 2);
}
@@ -982,7 +982,7 @@ const char *remove_leading_path(const char *in, const char *prefix)
strbuf_reset(&buf);
if (!in[j])
- strbuf_addstr(&buf, ".");
+ strbuf_addch(&buf, '.');
else
strbuf_addstr(&buf, in + j);
return buf.buf;
@@ -590,7 +590,7 @@ void pp_user_info(struct pretty_print_context *pp,
strbuf_addf(sb, "%s: ", what);
if (pp->fmt == CMIT_FMT_FULLER)
- strbuf_addchars(sb, ' ', 4);
+ strbuf_addstr(sb, " ");
strbuf_addf(&id, "%.*s <%.*s>", (int)namelen, namebuf,
(int)maillen, mailbuf);
@@ -65,7 +65,7 @@ static void send_info(struct repository *r, struct packet_writer *writer,
if (info->size) {
if (oid_object_info(r, &oid, &object_size) < 0) {
- strbuf_addstr(&send_buffer, " ");
+ strbuf_addch(&send_buffer, ' ');
} else {
strbuf_addf(&send_buffer, " %lu", object_size);
}
@@ -373,7 +373,7 @@ static int generate_push_cert(struct strbuf *req_buf,
if (args->push_options)
for_each_string_list_item(item, args->push_options)
strbuf_addf(&cert, "push-option %s\n", item->string);
- strbuf_addstr(&cert, "\n");
+ strbuf_addch(&cert, '\n');
for (ref = remote_refs; ref; ref = ref->next) {
if (check_to_send_update(ref, args) < 0)
@@ -1550,7 +1550,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
return GIT_DIR_DISALLOWED_BARE;
if (!ensure_valid_ownership(NULL, NULL, dir->buf, report))
return GIT_DIR_INVALID_OWNERSHIP;
- strbuf_addstr(gitdir, ".");
+ strbuf_addch(gitdir, '.');
return GIT_DIR_BARE;
}
@@ -226,7 +226,7 @@ static void fn_child_start_fl(const char *file, int line,
if (cmd->dir) {
strbuf_addstr(&buf_payload, " cd ");
sq_quote_buf_pretty(&buf_payload, cmd->dir);
- strbuf_addstr(&buf_payload, ";");
+ strbuf_addch(&buf_payload, ';');
}
/*