Merge branch 'js/commit-graph-chunk-table-fix'
[git.git] / t / t9831-git-p4-triggers.sh
blobbe44c9751aefa5368d6f05d7b1c29f0c8354095f
1 #!/bin/sh
3 test_description='git p4 with server triggers'
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 "change 1" &&
17 echo file2 >file2 &&
18 p4 add file2 &&
19 p4 submit -d "change 2"
23 test_expect_success 'clone with extra info lines from verbose p4 trigger' '
24 test_when_finished cleanup_git &&
26 p4 triggers -i <<-EOF
27 Triggers: p4triggertest-command command pre-user-change "echo verbose trigger"
28 EOF
29 ) &&
31 p4 change -o | grep -s "verbose trigger"
32 ) &&
33 git p4 clone --dest="$git" //depot/@all &&
35 p4 triggers -i <<-EOF
36 Triggers:
37 EOF
41 test_expect_success 'import with extra info lines from verbose p4 trigger' '
42 test_when_finished cleanup_git &&
44 cd "$cli" &&
45 echo file3 >file3 &&
46 p4 add file3 &&
47 p4 submit -d "change 3"
48 ) &&
50 p4 triggers -i <<-EOF
51 Triggers: p4triggertest-command command pre-user-describe "echo verbose trigger"
52 EOF
53 ) &&
55 p4 describe 1 | grep -s "verbose trigger"
56 ) &&
57 git p4 clone --dest="$git" //depot/@all &&
59 cd "$git" &&
60 git p4 sync
61 )&&
63 p4 triggers -i <<-EOF
64 Triggers:
65 EOF
69 test_expect_success 'submit description with extra info lines from verbose p4 change trigger' '
70 test_when_finished cleanup_git &&
72 p4 triggers -i <<-EOF
73 Triggers: p4triggertest-command command pre-user-change "echo verbose trigger"
74 EOF
75 ) &&
77 p4 change -o | grep -s "verbose trigger"
78 ) &&
79 git p4 clone --dest="$git" //depot &&
81 cd "$git" &&
82 git config git-p4.skipSubmitEdit true &&
83 echo file4 >file4 &&
84 git add file4 &&
85 git commit -m file4 &&
86 git p4 submit
87 ) &&
89 p4 triggers -i <<-EOF
90 Triggers:
91 EOF
92 ) &&
94 cd "$cli" &&
95 test_path_is_file file4
99 test_expect_success 'kill p4d' '
100 kill_p4d
103 test_done