3 test_description
='Clone repositories with non ASCII paths'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 UTF8_ESCAPED
="a-\303\244_o-\303\266_u-\303\274.txt"
9 ISO8859_ESCAPED
="a-\344_o-\366_u-\374.txt"
11 ISO8859
="$(printf "$ISO8859_ESCAPED")" &&
12 echo content123
>"$ISO8859" &&
14 skip_all
="fs does not accept ISO-8859-1 filenames"
18 test_expect_success
'start p4d' '
22 test_expect_success
'Create a repo containing iso8859-1 encoded paths' '
25 ISO8859="$(printf "$ISO8859_ESCAPED")" &&
26 echo content123 >"$ISO8859" &&
28 p4 submit -d "test commit"
32 test_expect_failure
'Clone auto-detects depot with iso8859-1 paths' '
33 git p4 clone --destination="$git" //depot &&
34 test_when_finished cleanup_git &&
37 UTF8="$(printf "$UTF8_ESCAPED")" &&
38 echo "$UTF8" >expect &&
39 git -c core.quotepath=false ls-files >actual &&
40 test_cmp expect actual
44 test_expect_success
'Clone repo containing iso8859-1 encoded paths with git-p4.pathEncoding' '
45 test_when_finished cleanup_git &&
49 git config git-p4.pathEncoding iso8859-1 &&
50 git p4 clone --use-client-spec --destination="$git" //depot &&
51 UTF8="$(printf "$UTF8_ESCAPED")" &&
52 echo "$UTF8" >expect &&
53 git -c core.quotepath=false ls-files >actual &&
54 test_cmp expect actual &&
56 echo content123 >expect &&
57 cat "$UTF8" >actual &&
58 test_cmp expect actual
62 test_expect_success
'Delete iso8859-1 encoded paths and clone' '
65 ISO8859="$(printf "$ISO8859_ESCAPED")" &&
66 p4 delete "$ISO8859" &&
67 p4 submit -d "remove file"
69 git p4 clone --destination="$git" //depot@all &&
70 test_when_finished cleanup_git &&
73 git -c core.quotepath=false ls-files >actual &&
74 test_must_be_empty actual