summaryrefslogtreecommitdiffstats
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-01 00:00:14 +0100
committerJunio C Hamano <gitster@pobox.com>2010-01-01 00:00:14 +0100
commit9bfff3ae5fdf1dcd0705056f7f9a42e81548797e (patch)
tree509488d440f0f8a7228189ce94e66d5acce5757f /builtin-branch.c
parentfast-import: Document author/committer/tagger name is optional (diff)
parentbranch: die explicitly why when calling "git branch [-a|-r] branchname". (diff)
downloadgit-9bfff3ae5fdf1dcd0705056f7f9a42e81548797e.tar.xz
git-9bfff3ae5fdf1dcd0705056f7f9a42e81548797e.zip
Merge branch 'maint-1.6.0' into maint
* maint-1.6.0: branch: die explicitly why when calling "git branch [-a|-r] branchname".
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index c87e63b02d..ddc9f2dab7 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -638,10 +638,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
rename_branch(head, argv[0], rename > 1);
else if (rename && (argc == 2))
rename_branch(argv[0], argv[1], rename > 1);
- else if (argc <= 2)
+ else if (argc <= 2) {
+ if (kinds != REF_LOCAL_BRANCH)
+ die("-a and -r options to 'git branch' do not make sense with a branch name");
create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
force_create, reflog, track);
- else
+ } else
usage_with_options(builtin_branch_usage, options);
return 0;