]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4258-am-quoted-cr.sh
The third batch
[thirdparty/git.git] / t / t4258-am-quoted-cr.sh
CommitLineData
59b519ab
ĐTCD
1#!/bin/sh
2
3test_description='test am --quoted-cr=<action>'
4
71c79160 5TEST_PASSES_SANITIZE_LEAK=true
59b519ab
ĐTCD
6. ./test-lib.sh
7
8DATA="$TEST_DIRECTORY/t4258"
9
10test_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
15'
16
17test_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
21'
22
23test_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
28'
29
6fc53692 30test_expect_success 'am with config mailinfo.quotedCr=strip' '
59b519ab
ĐTCD
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
36'
37
38test_done