summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-01 20:40:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-02-01 20:40:52 (GMT)
commitd3c0f7773feae66f5744cb33d0b074f0ef0c18a7 (patch)
tree41585bc35c000b5ef16d248879f63438381c3d14 /builtin/branch.c
parent4acfff9dda29ae700c8b053cf7af9d4bcdf73762 (diff)
parent75135b23f66afd362c864939ecd0d6871a87d769 (diff)
downloadgit-d3c0f7773feae66f5744cb33d0b074f0ef0c18a7.zip
git-d3c0f7773feae66f5744cb33d0b074f0ef0c18a7.tar.gz
git-d3c0f7773feae66f5744cb33d0b074f0ef0c18a7.tar.bz2
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/branch.c')
-rw-r--r--builtin/branch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 873f624..ea6498b 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);