checkout: proper error message on 'git checkout foo bar --'
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Fri, 18 Oct 2013 09:25:58 +0000 (11:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Oct 2013 19:57:16 +0000 (12:57 -0700)
The previous code was detecting the presence of "--" by looking only at
argument 1. As a result, "git checkout foo bar --" was interpreted as an
ambiguous file/revision list, and errored out with:

error: pathspec 'foo' did not match any file(s) known to git.
error: pathspec 'bar' did not match any file(s) known to git.
error: pathspec '--' did not match any file(s) known to git.

This patch fixes it by walking through the argument list to find the
"--", and now complains about the number of references given.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found