]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4015: let the test pass with any default branch name
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 18 Nov 2020 23:35:44 +0000 (23:35 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 19 Nov 2020 19:51:01 +0000 (11:51 -0800)
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>
t/t4015-diff-whitespace.sh

index 8bdaa0a693fa52adf2314d5777a195d035d6009c..47f0e2889dade09889aa84558ac6567748799cdb 100755 (executable)
@@ -877,13 +877,13 @@ test_expect_success 'rename empty' '
 test_expect_success 'combined diff with autocrlf conversion' '
 
        git reset --hard &&
-       echo >x hello &&
-       git commit -m "one side" x &&
+       test_commit "one side" x hello one-side &&
        git checkout HEAD^ &&
        echo >x goodbye &&
        git commit -m "the other side" x &&
        git config core.autocrlf true &&
-       test_must_fail git merge master &&
+       test_must_fail git merge one-side >actual &&
+       test_i18ngrep "Automatic merge failed" actual &&
 
        git diff >actual.raw &&
        sed -e "1,/^@@@/d" actual.raw >actual &&