summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2008-07-23 10:15:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-23 19:09:47 (GMT)
commitf5242ebf0dcd858ae9c72f39aed9773696d7283d (patch)
treea35c765ccd4b19437be5025bdb984254763d4829 /builtin-checkout.c
parent2d9c572578c72bd6691e80a9feed7d631baf007f (diff)
downloadgit-f5242ebf0dcd858ae9c72f39aed9773696d7283d.zip
git-f5242ebf0dcd858ae9c72f39aed9773696d7283d.tar.gz
git-f5242ebf0dcd858ae9c72f39aed9773696d7283d.tar.bz2
git-checkout: fix command line parsing.
This fixes an issue when you use: $ git checkout -- <path1> [<paths>...] and that <path1> can also be understood as a reference. git-checkout mistakenly understands this as the same as: $ git checkout <path1> -- [<paths>...] because parse-options was eating the '--' and the argument parser thought he was parsing: $ git checkout <path1> [<paths>...] Where there indeed is an ambiguity Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 93ea69b..aec2bc6 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))