{"thread":{"id":"22063","subject":"[PATCH] branch: die explicitly why when calling \"git branch [-a|-r] branchname\".","startedAt":"2009-12-30T14:45:31Z","lastAt":"2009-12-31T23:09:04Z","messageCount":2,"participants":["Matthieu Moy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130559","messageId":"1262184331-9102-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"22063","inReplyTo":null,"subject":"[PATCH] branch: die explicitly why when calling \"git branch [-a|-r] branchname\".","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-12-30T14:45:31Z","receivedAt":"2009-12-30T14:45:31Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The -a and -r options used to be silently ignored in such a command.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin-branch.c |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-branch.c b/builtin-branch.c\nindex c87e63b..8aef2bb 100644\n--- a/builtin-branch.c\n+++ b/builtin-branch.c\n@@ -638,10 +638,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\trename_branch(head, argv[0], rename > 1);\n \telse if (rename && (argc == 2))\n \t\trename_branch(argv[0], argv[1], rename > 1);\n-\telse if (argc <= 2)\n+\telse if (argc <= 2) {\n+\t\tif (kinds != REF_LOCAL_BRANCH) {\n+\t\t\tdie(\"-a and -r options to 'git branch' do not make sense with a branch name\");\n+\t\t}\n \t\tcreate_branch(head, argv[0], (argc == 2) ? argv[1] : head,\n \t\t\t      force_create, reflog, track);\n-\telse\n+\t} else\n \t\tusage_with_options(builtin_branch_usage, options);\n \n \treturn 0;\n-- \n1.6.6.71.gcc720.dirty\n"},{"id":"130638","messageId":"7vaawyrban.fsf@alter.siamese.dyndns.org","threadId":"22063","inReplyTo":"1262184331-9102-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] branch: die explicitly why when calling \"git branch [-a|-r] branchname\".","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-31T23:09:04Z","receivedAt":"2009-12-31T23:09:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; will apply to 'maint', together with the SubmittingPatches\naddition.\n\nInterestingly, this revealed a long-standing breakage in t5403.\n"}]}