test-ref-store: don't add newline to reflog message

By convention, reflog messages always end in '\n', so before we would print blank lines between entries. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Han-Wen Nienhuys committed Dec 2, 2021 at 17:36 UTC 21f0e8506119dc18c0b2396b5854d850cba7b00d
3 files changed +6 -8
t/helper/test-ref-store.c
+2 -3
@@ -152,9 +152,8 @@ static int each_reflog(struct object_id *old_oid, struct object_id *new_oid,
152 const char *committer, timestamp_t timestamp,
153 int tz, const char *msg, void *cb_data)
154 {
155 - printf("%s %s %s %"PRItime" %d %s\n",
156 - oid_to_hex(old_oid), oid_to_hex(new_oid),
157 - committer, timestamp, tz, msg);
155 + printf("%s %s %s %" PRItime " %d %s", oid_to_hex(old_oid),
156 + oid_to_hex(new_oid), committer, timestamp, tz, msg);
157 return 0;
158 }
159
t/t1405-main-ref-store.sh
+2 -3
@@ -89,13 +89,12 @@ test_expect_success 'for_each_reflog()' '
89 test_expect_success 'for_each_reflog_ent()' '
90 $RUN for-each-reflog-ent HEAD >actual &&
91 head -n1 actual | grep one &&
92 - tail -n2 actual | head -n1 | grep recreate-main
92 + tail -n1 actual | grep recreate-main
93 '
94
95 test_expect_success 'for_each_reflog_ent_reverse()' '
96 $RUN for-each-reflog-ent-reverse HEAD >actual &&
97 - head -n1 actual | grep recreate-main &&
98 - tail -n2 actual | head -n1 | grep one
97 + tail -n1 actual | grep one
98 '
99
100 test_expect_success 'reflog_exists(HEAD)' '
t/t1406-submodule-ref-store.sh
+2 -2
@@ -74,13 +74,13 @@ test_expect_success 'for_each_reflog()' '
74 test_expect_success 'for_each_reflog_ent()' '
75 $RUN for-each-reflog-ent HEAD >actual &&
76 head -n1 actual | grep first &&
77 - tail -n2 actual | head -n1 | grep main.to.new
77 + tail -n1 actual | grep main.to.new
78 '
79
80 test_expect_success 'for_each_reflog_ent_reverse()' '
81 $RUN for-each-reflog-ent-reverse HEAD >actual &&
82 head -n1 actual | grep main.to.new &&
83 - tail -n2 actual | head -n1 | grep first
83 + tail -n1 actual | grep first
84 '
85
86 test_expect_success 'reflog_exists(HEAD)' '