t4015: let the test pass with any default branch name

We do not need to hard-code the actual branch name, as we can use the `test_commit` function to simplify the code and use the tag it generates, thereby being a lot more precise in what we want. Strangely enough, this test case would have succeeded even with an overridden default branch name, obviously for the wrong reason. Let's verify that it passes for the expected reason, by looking for a tell-tale in Git's output. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Nov 18, 2020 at 23:35 UTC 26d0a6d47ab946f49e2aee40ae16f53915c397f4
1 file changed +3 -3
t/t4015-diff-whitespace.sh
+3 -3
@@ -877,13 +877,13 @@ test_expect_success 'rename empty' '
877 test_expect_success 'combined diff with autocrlf conversion' '
878
879 git reset --hard &&
880 - echo >x hello &&
881 - git commit -m "one side" x &&
880 + test_commit "one side" x hello one-side &&
881 git checkout HEAD^ &&
882 echo >x goodbye &&
883 git commit -m "the other side" x &&
884 git config core.autocrlf true &&
886 - test_must_fail git merge master &&
885 + test_must_fail git merge one-side >actual &&
886 + test_i18ngrep "Automatic merge failed" actual &&
887
888 git diff >actual.raw &&
889 sed -e "1,/^@@@/d" actual.raw >actual &&