3 test_description
='git-p4 submit'
7 test_expect_success
'start p4d' '
11 test_expect_success
'init depot' '
16 p4 submit -d "change 1"
20 test_expect_success
'submit with no client dir' '
21 test_when_finished cleanup_git &&
22 "$GITP4" clone --dest="$git" //depot &&
27 git commit -m "git commit 2" &&
29 git config git-p4.skipSubmitEdit true &&
34 # make two commits, but tell it to apply only from HEAD^
35 test_expect_success
'submit --origin' '
36 test_when_finished cleanup_git &&
37 "$GITP4" clone --dest="$git" //depot &&
40 test_commit "file3" &&
41 test_commit "file4" &&
42 git config git-p4.skipSubmitEdit true &&
43 "$GITP4" submit --origin=HEAD^
48 test_path_is_missing "file3.t" &&
49 test_path_is_file "file4.t"
53 test_expect_success
'submit with allowSubmit' '
54 test_when_finished cleanup_git &&
55 "$GITP4" clone --dest="$git" //depot &&
58 test_commit "file5" &&
59 git config git-p4.skipSubmitEdit true &&
60 git config git-p4.allowSubmit "nobranch" &&
61 test_must_fail "$GITP4" submit &&
62 git config git-p4.allowSubmit "nobranch,master" &&
67 test_expect_success
'submit with master branch name from argv' '
68 test_when_finished cleanup_git &&
69 "$GITP4" clone --dest="$git" //depot &&
72 test_commit "file6" &&
73 git config git-p4.skipSubmitEdit true &&
74 test_must_fail "$GITP4" submit nobranch &&
75 git branch otherbranch &&
76 git reset --hard HEAD^ &&
77 test_commit "file7" &&
78 "$GITP4" submit otherbranch
83 test_path_is_file "file6.t" &&
84 test_path_is_missing "file7.t"
88 test_expect_success
'kill p4d' '