t1510 (worktree): fix '&&' chaining
[git.git] / t / t9805-skip-submit-edit.sh
blob734ccf2fb9f3b01c1dffdd6c4858320d634cae03
1 #!/bin/sh
3 test_description='git-p4 skipSubmitEdit config variables'
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"
20 # this works because EDITOR is set to :
21 test_expect_success 'no config, unedited, say yes' '
22 "$GITP4" clone --dest="$git" //depot &&
23 test_when_finished cleanup_git &&
25 cd "$git" &&
26 echo line >>file1 &&
27 git commit -a -m "change 2" &&
28 echo y | "$GITP4" submit &&
29 p4 changes //depot/... >wc &&
30 test_line_count = 2 wc
34 test_expect_success 'no config, unedited, say no' '
35 "$GITP4" clone --dest="$git" //depot &&
36 test_when_finished cleanup_git &&
38 cd "$git" &&
39 echo line >>file1 &&
40 git commit -a -m "change 3 (not really)" &&
41 printf "bad response\nn\n" | "$GITP4" submit
42 p4 changes //depot/... >wc &&
43 test_line_count = 2 wc
47 test_expect_success 'skipSubmitEdit' '
48 "$GITP4" clone --dest="$git" //depot &&
49 test_when_finished cleanup_git &&
51 cd "$git" &&
52 git config git-p4.skipSubmitEdit true &&
53 # will fail if editor is even invoked
54 git config core.editor /bin/false &&
55 echo line >>file1 &&
56 git commit -a -m "change 3" &&
57 "$GITP4" submit &&
58 p4 changes //depot/... >wc &&
59 test_line_count = 3 wc
63 test_expect_success 'skipSubmitEditCheck' '
64 "$GITP4" clone --dest="$git" //depot &&
65 test_when_finished cleanup_git &&
67 cd "$git" &&
68 git config git-p4.skipSubmitEditCheck true &&
69 echo line >>file1 &&
70 git commit -a -m "change 4" &&
71 "$GITP4" submit &&
72 p4 changes //depot/... >wc &&
73 test_line_count = 4 wc
78 test_expect_success 'kill p4d' '
79 kill_p4d
82 test_done