aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-01 12:40:52 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-01 12:40:52 -0800
commitd3c0f7773feae66f5744cb33d0b074f0ef0c18a7 (patch)
tree41585bc35c000b5ef16d248879f63438381c3d14 /builtin
parent4acfff9dda29ae700c8b053cf7af9d4bcdf73762 (diff)
parent75135b23f66afd362c864939ecd0d6871a87d769 (diff)
downloadgit-d3c0f7773feae66f5744cb33d0b074f0ef0c18a7.tar.gz
git-d3c0f7773feae66f5744cb33d0b074f0ef0c18a7.tar.xz
Merge branch 'nd/edit-branch-desc-while-detached'
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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 873f624d1..ea6498b08 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);