Skip to content

Commit

Permalink
git-p4: add failing test for submit from detached head
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luke Diamand authored and Jeff King committed Nov 24, 2015
1 parent 7a2c4af commit 74b6fe9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions t/t9800-git-p4-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down

0 comments on commit 74b6fe9

Please sign in to comment.