Merge branch 'tg/git-remote'
[git/debian.git] / t / t9822-git-p4-path-encoding.sh
blob7b83e696a92a5c97e8c022af2601d60a95ab1cbc
1 #!/bin/sh
3 test_description='Clone repositories with non ASCII paths'
5 . ./lib-git-p4.sh
7 UTF8_ESCAPED="a-\303\244_o-\303\266_u-\303\274.txt"
8 ISO8859_ESCAPED="a-\344_o-\366_u-\374.txt"
10 test_expect_success 'start p4d' '
11 start_p4d
14 test_expect_success 'Create a repo containing iso8859-1 encoded paths' '
16 cd "$cli" &&
17 ISO8859="$(printf "$ISO8859_ESCAPED")" &&
18 echo content123 >"$ISO8859" &&
19 p4 add "$ISO8859" &&
20 p4 submit -d "test commit"
24 test_expect_failure 'Clone auto-detects depot with iso8859-1 paths' '
25 git p4 clone --destination="$git" //depot &&
26 test_when_finished cleanup_git &&
28 cd "$git" &&
29 UTF8="$(printf "$UTF8_ESCAPED")" &&
30 echo "$UTF8" >expect &&
31 git -c core.quotepath=false ls-files >actual &&
32 test_cmp expect actual
36 test_expect_success 'Clone repo containing iso8859-1 encoded paths with git-p4.pathEncoding' '
37 test_when_finished cleanup_git &&
39 cd "$git" &&
40 git init . &&
41 git config git-p4.pathEncoding iso8859-1 &&
42 git p4 clone --use-client-spec --destination="$git" //depot &&
43 UTF8="$(printf "$UTF8_ESCAPED")" &&
44 echo "$UTF8" >expect &&
45 git -c core.quotepath=false ls-files >actual &&
46 test_cmp expect actual &&
48 echo content123 >expect &&
49 cat "$UTF8" >actual &&
50 test_cmp expect actual
54 test_expect_success 'kill p4d' '
55 kill_p4d
58 test_done