From: Pierre Habouzit Date: Wed, 23 Jul 2008 10:15:32 +0000 (+0200) Subject: git-checkout: fix command line parsing. X-Git-Tag: v1.6.0-rc1~39^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5242ebf0dcd858ae9c72f39aed9773696d7283d;p=git.git git-checkout: fix command line parsing. This fixes an issue when you use: $ git checkout -- [...] and that can also be understood as a reference. git-checkout mistakenly understands this as the same as: $ git checkout -- [...] because parse-options was eating the '--' and the argument parser thought he was parsing: $ git checkout [...] Where there indeed is an ambiguity Signed-off-by: Pierre Habouzit Signed-off-by: Junio C Hamano --- diff --git a/builtin-checkout.c b/builtin-checkout.c index 93ea69bfa..aec2bc6f8 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -520,7 +520,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) opts.track = git_branch_track; - argc = parse_options(argc, argv, options, checkout_usage, 0); + argc = parse_options(argc, argv, options, checkout_usage, + PARSE_OPT_KEEP_DASHDASH); if (argc) { arg = argv[0]; if (get_sha1(arg, rev))