Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-04 22:04:44 +0400
committerJunio C Hamano <gitster@pobox.com>2013-02-04 22:04:44 +0400
commit6cc01490c368b6f54821acc0bd2b7bd9600342e3 (patch)
tree496be31771e5443375c124b6560b9a5c20a3ce82 /builtin
parent7f3d409cd18e74c1d3adf892dce70a2d02d0797a (diff)
parent75135b23f66afd362c864939ecd0d6871a87d769 (diff)
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.c8
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);