Skip to content

Commit 21f0e85

Browse files
hanwengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f246349 commit 21f0e85

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

t/helper/test-ref-store.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ static int each_reflog(struct object_id *old_oid, struct object_id *new_oid,
152152
const char *committer, timestamp_t timestamp,
153153
int tz, const char *msg, void *cb_data)
154154
{
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);
158157
return 0;
159158
}
160159

t/t1405-main-ref-store.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ test_expect_success 'for_each_reflog()' '
8989
test_expect_success 'for_each_reflog_ent()' '
9090
$RUN for-each-reflog-ent HEAD >actual &&
9191
head -n1 actual | grep one &&
92-
tail -n2 actual | head -n1 | grep recreate-main
92+
tail -n1 actual | grep recreate-main
9393
'
9494

9595
test_expect_success 'for_each_reflog_ent_reverse()' '
9696
$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
9998
'
10099

101100
test_expect_success 'reflog_exists(HEAD)' '

t/t1406-submodule-ref-store.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ test_expect_success 'for_each_reflog()' '
7474
test_expect_success 'for_each_reflog_ent()' '
7575
$RUN for-each-reflog-ent HEAD >actual &&
7676
head -n1 actual | grep first &&
77-
tail -n2 actual | head -n1 | grep main.to.new
77+
tail -n1 actual | grep main.to.new
7878
'
7979

8080
test_expect_success 'for_each_reflog_ent_reverse()' '
8181
$RUN for-each-reflog-ent-reverse HEAD >actual &&
8282
head -n1 actual | grep main.to.new &&
83-
tail -n2 actual | head -n1 | grep first
83+
tail -n1 actual | grep first
8484
'
8585

8686
test_expect_success 'reflog_exists(HEAD)' '

0 commit comments

Comments
 (0)