Merge branch 'js/var-git-shell-path'
[git/debian.git] / t / t4258-am-quoted-cr.sh
blob3573c9147f17c58d822cd52904349f548d68cd63
1 #!/bin/sh
3 test_description='test am --quoted-cr=<action>'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 DATA="$TEST_DIRECTORY/t4258"
10 test_expect_success 'setup' '
11 test_write_lines one two three >text &&
12 test_commit one text &&
13 test_write_lines one owt three >text &&
14 test_commit two text
17 test_expect_success 'am warn if quoted-cr is found' '
18 git reset --hard one &&
19 test_must_fail git am "$DATA/mbox" 2>err &&
20 grep "quoted CRLF detected" err
23 test_expect_success 'am --quoted-cr=strip' '
24 test_might_fail git am --abort &&
25 git reset --hard one &&
26 git am --quoted-cr=strip "$DATA/mbox" &&
27 git diff --exit-code HEAD two
30 test_expect_success 'am with config mailinfo.quotedCr=strip' '
31 test_might_fail git am --abort &&
32 git reset --hard one &&
33 test_config mailinfo.quotedCr strip &&
34 git am "$DATA/mbox" &&
35 git diff --exit-code HEAD two
38 test_done