summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2022-10-26 01:01:29 +0200
committerJunio C Hamano <gitster@pobox.com>2022-10-26 10:52:24 -0700
commit77e7267e47aac247244dc4fb3538baff7463261f (patch)
treeea3f2de70696e779b5199927c9e422bce9e62a6e /commit.h
parentdb29e6bbaed156ae9025ff0474fd788e58230367 (diff)
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>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions