Re: [PATCH] t5318: use 'test_cmp_bin' to compare commit-graph files
From: Derrick Stolee <hidden>
Date: 2018-08-13 11:24:39
On 8/12/2018 4:18 PM, SZEDER Gábor wrote:
quoted hunk ↗ jump to hunk
The commit-graph files are binary files, so they should not be compared with 'test_cmp', because that might cause issues on Windows, where 'test_cmp' is a shell function to deal with random LF-CRLF conversions. Use 'test_cmp_bin' instead. Signed-off-by: SZEDER Gábor <redacted> --- t/t5318-commit-graph.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 4f17d7701e..1c148ebf21 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh@@ -254,9 +254,9 @@ test_expect_success 'check that gc computes commit-graph' ' git config gc.writeCommitGraph true && git gc && cp $objdir/info/commit-graph commit-graph-after-gc && - ! test_cmp commit-graph-before-gc commit-graph-after-gc && + ! test_cmp_bin commit-graph-before-gc commit-graph-after-gc && git commit-graph write --reachable && - test_cmp commit-graph-after-gc $objdir/info/commit-graph + test_cmp_bin commit-graph-after-gc $objdir/info/commit-graph ' # the verify tests below expect the commit-graph to contain
Thanks, Szeder! I didn't know about test_cmp_bin, and I appreciate you keeping up test hygiene. Reviewed-by: Derrick Stolee <redacted>