git-p4: add failing test for submit from detached head
authorLuke Diamand <luke@diamand.org>
Sat, 21 Nov 2015 09:54:39 +0000 (09:54 +0000)
committerJeff King <peff@peff.net>
Tue, 24 Nov 2015 20:20:15 +0000 (15:20 -0500)
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>
t/t9800-git-p4-basic.sh
index 90d41ed954c829bfb3735f3cea9db336f74adb81..114b19fca823d553c94c9651e21e4f1e8e8357a6 100755 (executable)
@@ -241,6 +241,22 @@ test_expect_success 'unresolvable host in P4PORT should display error' '
        )
 '
 
+test_expect_failure 'submit from detached head' '
+       test_when_finished cleanup_git &&
+       git p4 clone --dest="$git" //depot &&
+       (
+               cd "$git" &&
+               git checkout p4/master &&
+               >detached_head_test &&
+               git add detached_head_test &&
+               git commit -m "add detached_head" &&
+               git config git-p4.skipSubmitEdit true &&
+               git p4 submit &&
+               git p4 rebase &&
+               git log p4/master | grep detached_head
+       )
+'
+
 test_expect_success 'kill p4d' '
        kill_p4d
 '