Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 0f224e5

Browse files
Pete Wyckoffgitster
authored andcommitted
git p4: test submit
Try each of the five diff patterns that might happen during submit. Signed-off-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8d7ec36 commit 0f224e5

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

t/t9807-git-p4-submit.sh

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,98 @@ test_expect_success 'submit with master branch name from argv' '
8888
)
8989
'
9090

91+
#
92+
# Basic submit tests, the five handled cases
93+
#
94+
95+
test_expect_success 'submit modify' '
96+
test_when_finished cleanup_git &&
97+
git p4 clone --dest="$git" //depot &&
98+
(
99+
cd "$git" &&
100+
git config git-p4.skipSubmitEdit true &&
101+
echo line >>file1 &&
102+
git add file1 &&
103+
git commit -m file1 &&
104+
git p4 submit
105+
) &&
106+
(
107+
cd "$cli" &&
108+
test_path_is_file file1 &&
109+
test_line_count = 2 file1
110+
)
111+
'
112+
113+
test_expect_success 'submit add' '
114+
test_when_finished cleanup_git &&
115+
git p4 clone --dest="$git" //depot &&
116+
(
117+
cd "$git" &&
118+
git config git-p4.skipSubmitEdit true &&
119+
echo file13 >file13 &&
120+
git add file13 &&
121+
git commit -m file13 &&
122+
git p4 submit
123+
) &&
124+
(
125+
cd "$cli" &&
126+
test_path_is_file file13
127+
)
128+
'
129+
130+
test_expect_success 'submit delete' '
131+
test_when_finished cleanup_git &&
132+
git p4 clone --dest="$git" //depot &&
133+
(
134+
cd "$git" &&
135+
git config git-p4.skipSubmitEdit true &&
136+
git rm file4.t &&
137+
git commit -m "delete file4.t" &&
138+
git p4 submit
139+
) &&
140+
(
141+
cd "$cli" &&
142+
test_path_is_missing file4.t
143+
)
144+
'
145+
146+
test_expect_success 'submit copy' '
147+
test_when_finished cleanup_git &&
148+
git p4 clone --dest="$git" //depot &&
149+
(
150+
cd "$git" &&
151+
git config git-p4.skipSubmitEdit true &&
152+
git config git-p4.detectCopies true &&
153+
git config git-p4.detectCopiesHarder true &&
154+
cp file5.t file5.ta &&
155+
git add file5.ta &&
156+
git commit -m "copy to file5.ta" &&
157+
git p4 submit
158+
) &&
159+
(
160+
cd "$cli" &&
161+
test_path_is_file file5.ta
162+
)
163+
'
164+
165+
test_expect_success 'submit rename' '
166+
test_when_finished cleanup_git &&
167+
git p4 clone --dest="$git" //depot &&
168+
(
169+
cd "$git" &&
170+
git config git-p4.skipSubmitEdit true &&
171+
git config git-p4.detectRenames true &&
172+
git mv file6.t file6.ta &&
173+
git commit -m "rename file6.t to file6.ta" &&
174+
git p4 submit
175+
) &&
176+
(
177+
cd "$cli" &&
178+
test_path_is_missing file6.t &&
179+
test_path_is_file file6.ta
180+
)
181+
'
182+
91183
test_expect_success 'kill p4d' '
92184
kill_p4d
93185
'

0 commit comments

Comments
 (0)