Skip to content

Commit

Permalink
branch: no detached HEAD check when editing another branch's description
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jan 30, 2013
1 parent 7e20105 commit 75135b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,11 +822,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
const char *branch_name;
struct strbuf branch_ref = STRBUF_INIT;

if (detached)
die("Cannot give description to detached HEAD");
if (!argc)
if (!argc) {
if (detached)
die("Cannot give description to detached HEAD");
branch_name = head;
else if (argc == 1)
} else if (argc == 1)
branch_name = argv[0];
else
usage_with_options(builtin_branch_usage, options);
Expand Down

0 comments on commit 75135b2

Please sign in to comment.