archive: "--list" does not take further options
"git archive --list blah" should notice an extra command line parameter that goes unused. Make it so. Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
564d0252ca
commit
d6b6cd1393
|
@ -685,6 +685,8 @@ static int parse_archive_args(int argc, const char **argv,
|
|||
base = "";
|
||||
|
||||
if (list) {
|
||||
if (argc)
|
||||
die(_("extra command line parameter '%s'"), *argv);
|
||||
for (i = 0; i < nr_archivers; i++)
|
||||
if (!is_remote || archivers[i]->flags & ARCHIVER_REMOTE)
|
||||
printf("%s\n", archivers[i]->name);
|
||||
|
|
|
@ -124,6 +124,16 @@ test_expect_success 'setup' '
|
|||
EOF
|
||||
'
|
||||
|
||||
test_expect_success '--list notices extra parameters' '
|
||||
test_must_fail git archive --list blah &&
|
||||
test_must_fail git archive --remote=. --list blah
|
||||
'
|
||||
|
||||
test_expect_success 'end-of-options is correctly eaten' '
|
||||
git archive --list --end-of-options &&
|
||||
git archive --remote=. --list --end-of-options
|
||||
'
|
||||
|
||||
test_expect_success 'populate workdir' '
|
||||
mkdir a &&
|
||||
echo simple textfile >a/a &&
|
||||
|
|
Loading…
Reference in New Issue