diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-31 21:32:08 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-31 21:32:08 (GMT) |
commit | f5f55a1046d85bd78244d25617358f48619785f8 (patch) | |
tree | d64b02de7308c6ae3767b92b1492ed9bbae505de /t | |
parent | 2b3f61dc8b5ee4ee5b1c1ad8bdeebce52244a3a6 (diff) | |
parent | b10731f43dc21fa47c275052e7c074c686335cd3 (diff) | |
download | git-f5f55a1046d85bd78244d25617358f48619785f8.zip git-f5f55a1046d85bd78244d25617358f48619785f8.tar.gz git-f5f55a1046d85bd78244d25617358f48619785f8.tar.bz2 |
Merge branch 'km/branch-get-push-while-detached' into maint
"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
Diffstat (limited to 't')
-rwxr-xr-x | t/t1514-rev-parse-push.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh index 7214f5b..623a32a 100755 --- a/t/t1514-rev-parse-push.sh +++ b/t/t1514-rev-parse-push.sh @@ -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 |