t0300: work around bug in dash 0.5.6
[git.git] / t / t9803-git-p4-shell-metachars.sh
blobdb04375a13a14fd76bfde30f2a2d5cea644440c9
1 #!/bin/sh
3 test_description='git-p4 transparency to shell metachars in filenames'
5 . ./lib-git-p4.sh
7 test_expect_success 'start p4d' '
8 start_p4d
11 test_expect_success 'init depot' '
13 cd "$cli" &&
14 echo file1 >file1 &&
15 p4 add file1 &&
16 p4 submit -d "file1"
20 test_expect_success 'shell metachars in filenames' '
21 "$GITP4" clone --dest="$git" //depot &&
22 test_when_finished cleanup_git &&
24 cd "$git" &&
25 git config git-p4.skipSubmitEditCheck true &&
26 echo f1 >foo\$bar &&
27 git add foo\$bar &&
28 echo f2 >"file with spaces" &&
29 git add "file with spaces" &&
30 git commit -m "add files" &&
31 P4EDITOR=touch "$GITP4" submit
32 ) &&
34 cd "$cli" &&
35 p4 sync ... &&
36 test -e "file with spaces" &&
37 test -e "foo\$bar"
41 test_expect_success 'deleting with shell metachars' '
42 "$GITP4" clone --dest="$git" //depot &&
43 test_when_finished cleanup_git &&
45 cd "$git" &&
46 git config git-p4.skipSubmitEditCheck true &&
47 git rm foo\$bar &&
48 git rm file\ with\ spaces &&
49 git commit -m "remove files" &&
50 P4EDITOR=touch "$GITP4" submit
51 ) &&
53 cd "$cli" &&
54 p4 sync ... &&
55 test ! -e "file with spaces" &&
56 test ! -e foo\$bar
60 test_expect_success 'kill p4d' '
61 kill_p4d
64 test_done