{"thread":{"id":"27273","subject":"[PATCH v2] builtin/checkout.c: show usage with options on missing argument 'branch'","startedAt":"2011-05-05T17:18:10Z","lastAt":"2011-05-05T17:18:10Z","messageCount":1,"participants":["Ralf Thielow"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"167129","messageId":"1304615890-12840-1-git-send-email-ralf.thielow@googlemail.com","threadId":"27273","inReplyTo":null,"subject":"[PATCH v2] builtin/checkout.c: show usage with options on missing argument 'branch'","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@googlemail.com","sentAt":"2011-05-05T17:18:10Z","receivedAt":"2011-05-05T17:18:10Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"Show the usage with options for 'checkout' command on missing argument 'branch'.\n\nSigned-off-by: Ralf Thielow <ralf.thielow@googlemail.com>\n---\n builtin/checkout.c |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 38632fc..4aa613a 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -1086,5 +1086,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \tif (opts.writeout_stage)\n \t\tdie(_(\"--ours/--theirs is incompatible with switching branches.\"));\n \n+\tif (new.name == NULL) {\n+\t\tusage_with_options(checkout_usage, options);\n+\t\treturn 1;\n+\t}\n+\n \treturn switch_branches(&opts, &new);\n }\n-- \n1.7.5.1\n"}]}