From: Junio C Hamano Date: Wed, 30 Jan 2013 17:01:41 +0000 (-0800) Subject: Merge branch 'nd/edit-branch-desc-while-detached' into HEAD X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=35484d4acd69ac9e482c1c0ee4c5014744dfc63f;p=git.git Merge branch 'nd/edit-branch-desc-while-detached' into HEAD * nd/edit-branch-desc-while-detached: branch: no detached HEAD check when editing another branch's description --- 35484d4acd69ac9e482c1c0ee4c5014744dfc63f diff --cc builtin/branch.c index 531a21e83,ea10bce3b..ca61c5ba5 --- a/builtin/branch.c +++ b/builtin/branch.c @@@ -852,14 -822,14 +852,14 @@@ int cmd_branch(int argc, const char **a 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); + die(_("cannot edit description of more than one branch")); strbuf_addf(&branch_ref, "refs/heads/%s", branch_name); if (!ref_exists(branch_ref.buf)) {