mirror of
https://github.com/git/git
synced 2024-09-13 21:34:42 +00:00
Merge branch 'jc/archive-list-with-extra-args' into maint-2.43
"git archive --list extra garbage" silently ignored excess command line parameters, which has been corrected. * jc/archive-list-with-extra-args: archive: "--list" does not take further options
This commit is contained in:
commit
878f8c42dc
|
@ -685,6 +685,8 @@ static int parse_archive_args(int argc, const char **argv,
|
||||||
base = "";
|
base = "";
|
||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
|
if (argc)
|
||||||
|
die(_("extra command line parameter '%s'"), *argv);
|
||||||
for (i = 0; i < nr_archivers; i++)
|
for (i = 0; i < nr_archivers; i++)
|
||||||
if (!is_remote || archivers[i]->flags & ARCHIVER_REMOTE)
|
if (!is_remote || archivers[i]->flags & ARCHIVER_REMOTE)
|
||||||
printf("%s\n", archivers[i]->name);
|
printf("%s\n", archivers[i]->name);
|
||||||
|
|
|
@ -124,6 +124,16 @@ test_expect_success 'setup' '
|
||||||
EOF
|
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' '
|
test_expect_success 'populate workdir' '
|
||||||
mkdir a &&
|
mkdir a &&
|
||||||
echo simple textfile >a/a &&
|
echo simple textfile >a/a &&
|
||||||
|
|
Loading…
Reference in a new issue