push: factor out the detached HEAD error message
commit35ee69c0f6c77f293b66125d334467d9692ef866
authorRamkumar Ramachandra <artagnon@gmail.com>
Wed, 29 May 2013 19:21:49 +0000 (30 00:51 +0530)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 May 2013 19:31:10 +0000 (29 12:31 -0700)
treea23b02502cc34070e0d195a2048ffd8bc36e1fd8
parentedca4152560522a431a51fc0a06147fc680b5b18
push: factor out the detached HEAD error message

With push.default set to upstream or simple, and a detached HEAD, git
push prints the following error:

  $ git push
  fatal: You are not currently on a branch.
  To push the history leading to the current (detached HEAD)
  state now, use

    git push ram HEAD:<name-of-remote-branch>

This error is not unique to upstream or simple: current cannot push with
a detached HEAD either.  So, factor out the error string in preparation
for using it in current.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/push.c