Files
git/builtin
Rubén Justo 77e7267e47 branch: error copying or renaming a detached HEAD
In c847f53712 (Detached HEAD (experimental), 2007-01-01) an error
condition was introduced in rename_branch() to prevent renaming, later
also copying, a detached HEAD.

The condition used was checking for NULL in oldname, the source branch
to rename/copy.  That condition cannot be satisfied because if no source
branch is specified, HEAD is going to be used in the call.

The error issued instead is:

	fatal: Invalid branch name: 'HEAD'

Let's remove the condition in copy_or_rename_branch() (the current
function name) and check for HEAD before calling it, dying with the
original intended error if we're in a detached HEAD.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-26 10:52:24 -07:00
..
2022-06-07 14:10:56 -07:00
2022-04-06 09:42:14 -07:00
2022-08-05 15:52:14 -07:00
2022-02-17 16:25:05 -08:00
2022-10-17 15:46:09 -07:00
2022-10-01 15:58:38 -07:00
2022-09-14 12:56:39 -07:00
2022-10-10 10:08:39 -07:00
2022-10-11 10:36:12 -07:00
2022-09-02 10:02:56 -07:00
2022-09-14 12:56:39 -07:00
2022-09-19 14:35:23 -07:00
2022-08-08 13:23:26 -07:00
2022-09-14 12:56:39 -07:00