@@ -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);
@@ -341,13 +341,11 @@ static void write_author_script(const struct am_state *state)
strbuf_addstr(&sb, "GIT_AUTHOR_NAME=");
sq_quote_buf(&sb, state->author_name);
- strbuf_addch(&sb, '\n');
- strbuf_addstr(&sb, "GIT_AUTHOR_EMAIL=");
+ strbuf_addstr(&sb, "\nGIT_AUTHOR_EMAIL=");
sq_quote_buf(&sb, state->author_email);
- strbuf_addch(&sb, '\n');
- strbuf_addstr(&sb, "GIT_AUTHOR_DATE=");
+ strbuf_addstr(&sb, "\nGIT_AUTHOR_DATE=");
sq_quote_buf(&sb, state->author_date);
strbuf_addch(&sb, '\n');
@@ -148,11 +148,9 @@ static void get_ac_line(const char *inbuf, const char *what,
if (split_ident_line(&ident, tmp, len)) {
error_out:
- /* Ugh */
- tmp = "(unknown)";
- strbuf_addstr(name, tmp);
- strbuf_addstr(mail, tmp);
- strbuf_addstr(tz, tmp);
+ strbuf_addstr(name, "(unknown)");
+ strbuf_addstr(mail, "(unknown)");
+ strbuf_addstr(tz, "(unknown)");
*time = 0;
return;
}
@@ -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, '-');
}
}
@@ -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);
@@ -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;
@@ -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);
}
@@ -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, ';');
}
/*