Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-checkout: fix command line parsing.
author
Pierre Habouzit
<madcoder@debian.org>
Wed, 23 Jul 2008 10:15:32 +0000
(12:15 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 23 Jul 2008 19:09:47 +0000
(12:09 -0700)
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>
builtin-checkout.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
2d9c572
)
diff --git
a/builtin-checkout.c
b/builtin-checkout.c
index 93ea69bfaa083f49a6e808c7317ea1910b29c847..aec2bc6f8d71a41e9d1cb718a498bfea08b767c3 100644
(file)
--- 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))