Merge branch 'km/branch-get-push-while-detached'

"git <cmd> @{push}" on a detached HEAD used to segfault; it has
been corrected to error out with a message.

* km/branch-get-push-while-detached:
  branch_get_push: do not segfault when HEAD is detached
This commit is contained in:
Junio C Hamano
2017-01-18 15:12:14 -08:00
2 changed files with 9 additions and 3 deletions

View File

@ -60,4 +60,10 @@ test_expect_success '@{push} with push refspecs' '
resolve topic@{push} refs/remotes/origin/magic/topic
'
test_expect_success 'resolving @{push} fails with a detached HEAD' '
git checkout HEAD^0 &&
test_when_finished "git checkout -" &&
test_must_fail git rev-parse @{push}
'
test_done