Skip to content

Commit 74b6fe9

Browse files
luked99peff
authored andcommitted
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 <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent 7a2c4af commit 74b6fe9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t9800-git-p4-basic.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,22 @@ test_expect_success 'unresolvable host in P4PORT should display error' '
241241
)
242242
'
243243

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+
244260
test_expect_success 'kill p4d' '
245261
kill_p4d
246262
'

0 commit comments

Comments
 (0)