summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-01-30 09:01:41 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-01-30 09:01:41 -0800
commit35484d4acd69ac9e482c1c0ee4c5014744dfc63f (patch)
tree5443a30b772d037c4a2924d3ab912ce297c48568
parentbranch: give a more helpful message on redundant arguments (diff)
parentbranch: no detached HEAD check when editing another branch's description (diff)
downloadtgif-35484d4acd69ac9e482c1c0ee4c5014744dfc63f.tar.xz
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
-rw-r--r--builtin/branch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 531a21e831..ca61c5ba59 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -852,11 +852,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
die(_("cannot edit description of more than one branch"));