From 989eea958bb3a334c73abcfffb9aa3ec3ed56766 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 24 Feb 2020 19:08:13 +0530 Subject: lib-log-graph: consolidate test_cmp_graph logic Log graph comparision logic is duplicated many times in: - t3430-rebase-merges.sh - t4202-log.sh - t4214-log-graph-octopus.sh - t4215-log-skewed-merges.sh Consolidate the core of the comparision and sanitization logic in lib-log-graph, and use it to replace the existing tests. While at it, lose the singular/plural transition magic from the sanitize_output helper, which was necessary around 7f814632 ("Use correct grammar in diffstat summary line", 2012-02-01), that has long outlived its usefulness. Signed-off-by: Abhishek Kumar Signed-off-by: Junio C Hamano --- t/t3430-rebase-merges.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 't/t3430-rebase-merges.sh') diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index e72ca348ea..a1bc3e2001 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -20,12 +20,11 @@ Initial setup: ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh +. "$TEST_DIRECTORY"/lib-log-graph.sh test_cmp_graph () { cat >expect && - git log --graph --boundary --format=%s "$@" >output && - sed "s/ *$//" output.trimmed && - test_cmp expect output.trimmed + lib_test_cmp_graph --boundary --format=%s "$@" } test_expect_success 'setup' ' -- cgit v1.2.1