summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-01-28 01:18:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-30 16:59:56 (GMT)
commit75135b23f66afd362c864939ecd0d6871a87d769 (patch)
treeebb7a661371098a5fcc8205037d538f043614208
parent7e2010537e96d0a1144520222f20ba1dc3d61441 (diff)
downloadgit-75135b23f66afd362c864939ecd0d6871a87d769.zip
git-75135b23f66afd362c864939ecd0d6871a87d769.tar.gz
git-75135b23f66afd362c864939ecd0d6871a87d769.tar.bz2
branch: no detached HEAD check when editing another branch's description
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/branch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 0e060f2..ea10bce 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -822,11 +822,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);