summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-01 20:49:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-01 20:49:13 (GMT)
commitdc3c6fb56557bfa4a4f5ed5abca25f119ded6cde (patch)
tree1dc405e1d929d69cd95eb998472f5e05c2b4a3f8
parent341a196ab6603aa7be709812132fd906a3d2359c (diff)
parent25429fed5ce134bce9f729d927ac397badae1959 (diff)
downloadgit-dc3c6fb56557bfa4a4f5ed5abca25f119ded6cde.zip
git-dc3c6fb56557bfa4a4f5ed5abca25f119ded6cde.tar.gz
git-dc3c6fb56557bfa4a4f5ed5abca25f119ded6cde.tar.bz2
Merge branch 'hn/reftable' into master
Brown-paper-bag fix. * hn/reftable: refs: move the logic to add \t to reflog to the files backend
-rw-r--r--refs.c1
-rw-r--r--refs/files-backend.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/refs.c b/refs.c
index 89814c7..2dd851f 100644
--- a/refs.c
+++ b/refs.c
@@ -907,7 +907,6 @@ static void copy_reflog_msg(struct strbuf *sb, const char *msg)
char c;
int wasspace = 1;
- strbuf_addch(sb, '\t');
while ((c = *msg++)) {
if (wasspace && isspace(c))
continue;
diff --git a/refs/files-backend.c b/refs/files-backend.c
index e0aba23..985631f 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1628,8 +1628,10 @@ static int log_ref_write_fd(int fd, const struct object_id *old_oid,
int ret = 0;
strbuf_addf(&sb, "%s %s %s", oid_to_hex(old_oid), oid_to_hex(new_oid), committer);
- if (msg && *msg)
+ if (msg && *msg) {
+ strbuf_addch(&sb, '\t');
strbuf_addstr(&sb, msg);
+ }
strbuf_addch(&sb, '\n');
if (write_in_full(fd, sb.buf, sb.len) < 0)
ret = -1;