summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-02-01 12:40:52 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-02-01 12:40:52 -0800
commitd3c0f7773feae66f5744cb33d0b074f0ef0c18a7 (patch)
tree41585bc35c000b5ef16d248879f63438381c3d14 /builtin
parentMerge branch 'jk/gc-auto-after-fetch' (diff)
parentbranch: no detached HEAD check when editing another branch's description (diff)
downloadtgif-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 873f624d1c..ea6498b08a 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);