3 test_description='Clone repositories with non ASCII commit messages'
7 UTF8="$(printf "a-\303\244_o-\303\266_u-\303\274")"
8 ISO8859="$(printf "a-\344_o-\366_u-\374")"
10 test_expect_success 'start p4d' '
14 test_expect_success 'create commits in perforce' '
18 p4_add_user "${UTF8}" &&
19 p4_add_user "${ISO8859}" &&
22 P4USER="${UTF8}" p4 add dummy-file1 &&
23 P4USER="${UTF8}" p4 submit -d "message ${UTF8}" &&
26 P4USER="${ISO8859}" p4 add dummy-file2 &&
27 P4USER="${ISO8859}" p4 submit -d "message ${ISO8859}"
31 test_expect_success 'check UTF-8 commit' '
33 git p4 clone --destination="$git/1" //depot@1,1 &&
34 git -C "$git/1" cat-file commit HEAD | grep -q "^message ${UTF8}$" &&
35 git -C "$git/1" cat-file commit HEAD | grep -q "^author Dr. ${UTF8} <${UTF8}@example.com>"
39 test_expect_success 'check ISO-8859 commit' '
41 git p4 clone --destination="$git/2" //depot@2,2 &&
42 git -C "$git/2" cat-file commit HEAD > /tmp/dump.txt &&
43 git -C "$git/2" cat-file commit HEAD | grep -q "^message ${ISO8859}$" &&
44 git -C "$git/2" cat-file commit HEAD | grep -q "^author Dr. ${ISO8859} <${ISO8859}@example.com>"