git-p4: add failing test for submit from detached head
git-p4 can't submit from a detached head. This test case demonstrates the problem. Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Jeff King <peff@peff.net>
Luke Diamand committed
Nov 21, 2015 at 09:54 UTC
74b6fe9202792f43ba01014599c8fe183149c0a3
1 file changed
+16
t/t9800-git-p4-basic.sh
+16
@@ -241,6 +241,22 @@ test_expect_success 'unresolvable host in P4PORT should display error' '
241
)
242
'
243
244
+test_expect_failure 'submit from detached head' '
245
+ test_when_finished cleanup_git &&
246
+ git p4 clone --dest="$git" //depot &&
247
+ (
248
+ cd "$git" &&
249
+ git checkout p4/master &&
250
+ >detached_head_test &&
251
+ git add detached_head_test &&
252
+ git commit -m "add detached_head" &&
253
+ git config git-p4.skipSubmitEdit true &&
254
+ git p4 submit &&
255
+ git p4 rebase &&
256
+ git log p4/master | grep detached_head
257
+ )
258
+'
259
+
260
test_expect_success 'kill p4d' '
261
kill_p4d
262
'