diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-02-04 10:04:44 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-04 10:04:44 -0800 |
commit | 6cc01490c368b6f54821acc0bd2b7bd9600342e3 (patch) | |
tree | 496be31771e5443375c124b6560b9a5c20a3ce82 /builtin | |
parent | Merge branch 'jn/do-not-drop-username-when-reading-from-etc-mailname' into maint (diff) | |
parent | branch: no detached HEAD check when editing another branch's description (diff) | |
download | tgif-6cc01490c368b6f54821acc0bd2b7bd9600342e3.tar.xz |
Merge branch 'nd/edit-branch-desc-while-detached' into maint
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
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 1ec9c02612..947c84be2d 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -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); |