Skip to content

Commit

Permalink
Merge branch 'nd/edit-branch-desc-while-detached' into maint
Browse files Browse the repository at this point in the history
Attempt to "branch --edit-description" an existing branch, while
being on a detached HEAD, errored out.

* nd/edit-branch-desc-while-detached:
  branch: no detached HEAD check when editing another branch's description
  • Loading branch information
Junio C Hamano committed Feb 4, 2013
2 parents 7f3d409 + 75135b2 commit 6cc0149
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 @@ -850,11 +850,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 6cc0149

Please sign in to comment.