t/README: add missing value for GIT_TEST_DEFAULT_REF_FORMAT
[git/gitster.git] / t / t9831-git-p4-triggers.sh
blobf287f41e3741e10b2576a9d554a8be20d1778fe2
1 #!/bin/sh
3 test_description='git p4 with server triggers'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./lib-git-p4.sh
8 test_expect_success 'start p4d' '
9 start_p4d
12 test_expect_success 'init depot' '
14 cd "$cli" &&
15 echo file1 >file1 &&
16 p4 add file1 &&
17 p4 submit -d "change 1" &&
18 echo file2 >file2 &&
19 p4 add file2 &&
20 p4 submit -d "change 2"
24 test_expect_success 'clone with extra info lines from verbose p4 trigger' '
25 test_when_finished cleanup_git &&
27 p4 triggers -i <<-EOF
28 Triggers: p4triggertest-command command pre-user-change "echo verbose trigger"
29 EOF
30 ) &&
32 p4 change -o | grep -s "verbose trigger"
33 ) &&
34 git p4 clone --dest="$git" //depot/@all &&
36 p4 triggers -i <<-EOF
37 Triggers:
38 EOF
42 test_expect_success 'import with extra info lines from verbose p4 trigger' '
43 test_when_finished cleanup_git &&
45 cd "$cli" &&
46 echo file3 >file3 &&
47 p4 add file3 &&
48 p4 submit -d "change 3"
49 ) &&
51 p4 triggers -i <<-EOF
52 Triggers: p4triggertest-command command pre-user-describe "echo verbose trigger"
53 EOF
54 ) &&
56 p4 describe 1 | grep -s "verbose trigger"
57 ) &&
58 git p4 clone --dest="$git" //depot/@all &&
60 cd "$git" &&
61 git p4 sync
62 ) &&
64 p4 triggers -i <<-EOF
65 Triggers:
66 EOF
70 test_expect_success 'submit description with extra info lines from verbose p4 change trigger' '
71 test_when_finished cleanup_git &&
73 p4 triggers -i <<-EOF
74 Triggers: p4triggertest-command command pre-user-change "echo verbose trigger"
75 EOF
76 ) &&
78 p4 change -o | grep -s "verbose trigger"
79 ) &&
80 git p4 clone --dest="$git" //depot &&
82 cd "$git" &&
83 git config git-p4.skipSubmitEdit true &&
84 echo file4 >file4 &&
85 git add file4 &&
86 git commit -m file4 &&
87 git p4 submit
88 ) &&
90 p4 triggers -i <<-EOF
91 Triggers:
92 EOF
93 ) &&
95 cd "$cli" &&
96 test_path_is_file file4
100 test_done