Skip to content

Commit 2a73022

Browse files
bk2204gitster
authored andcommitted
t4205: sort log output in a hash-independent way
This test enumerates log entries and then sorts them. For SHA-1, this produces results that happen to sort in the order specified in the test, but for other hash algorithms they sort differently. Ensure we sort the log entries in a hash-independent way by sorting on the ref name instead of the object ID. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d29d500 commit 2a73022

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t4205-log-pretty-formats.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,22 +516,22 @@ test_expect_success 'log decoration properly follows tag chain' '
516516
git commit --amend -m shorter &&
517517
git log --no-walk --tags --pretty="%H %d" --decorate=full >actual &&
518518
cat <<-EOF >expected &&
519-
$head1 (tag: refs/tags/tag2)
520519
$head2 (tag: refs/tags/message-one)
521520
$old_head1 (tag: refs/tags/message-two)
521+
$head1 (tag: refs/tags/tag2)
522522
EOF
523-
sort actual >actual1 &&
523+
sort -k3 actual >actual1 &&
524524
test_cmp expected actual1
525525
'
526526

527527
test_expect_success 'clean log decoration' '
528528
git log --no-walk --tags --pretty="%H %D" --decorate=full >actual &&
529529
cat >expected <<-EOF &&
530-
$head1 tag: refs/tags/tag2
531530
$head2 tag: refs/tags/message-one
532531
$old_head1 tag: refs/tags/message-two
532+
$head1 tag: refs/tags/tag2
533533
EOF
534-
sort actual >actual1 &&
534+
sort -k3 actual >actual1 &&
535535
test_cmp expected actual1
536536
'
537537

0 commit comments

Comments
 (0)