diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-10 00:48:47 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-10 00:48:47 -0800 |
commit | 96aa7adda3b0254e4b9904f53bb38cd76bfea7bb (patch) | |
tree | d1eb57fbedb2e8c321889794c60ded86a9a2e88b /builtin-branch.c | |
parent | 70d7099916c9621e157c620f9cc7fc982f109c55 (diff) | |
parent | 0606c36a73449e76d8f6133253c1eff291ee8c97 (diff) | |
download | git-96aa7adda3b0254e4b9904f53bb38cd76bfea7bb.tar.gz git-96aa7adda3b0254e4b9904f53bb38cd76bfea7bb.tar.xz |
Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
base85: Make the code more obvious instead of explaining the non-obvious
base85: encode_85() does not use the decode table
base85 debug code: Fix length byte calculation
checkout -m: do not try to fall back to --merge from an unborn branch
branch: die explicitly why when calling "git branch [-a|-r] branchname".
Diffstat (limited to 'builtin-branch.c')
-rw-r--r-- | builtin-branch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-branch.c b/builtin-branch.c index 23b6949fe..7c6158711 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -583,10 +583,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; |