diff options
-rw-r--r-- | builtin/pack-objects.c | 15 | ||||
-rwxr-xr-x | t/t5300-pack-object.sh | 4 |
2 files changed, 5 insertions, 14 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 297f792851..80e3114573 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2484,23 +2484,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) usage(pack_usage); } - /* Traditionally "pack-objects [options] base extra" failed; - * we would however want to take refs parameter that would - * have been given to upstream rev-list ourselves, which means - * we somehow want to say what the base name is. So the - * syntax would be: - * - * pack-objects [options] base <refs...> - * - * in other words, we would treat the first non-option as the - * base_name and send everything else to the internal revision - * walker. - */ - if (!pack_to_stdout) base_name = argv[i++]; - if (pack_to_stdout != !base_name) + if (pack_to_stdout != !base_name || argv[i]) usage(pack_usage); if (!pack_to_stdout && !pack_size_limit) diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 602806d09c..d9d856b87b 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -38,6 +38,10 @@ test_expect_success \ 'pack without delta' \ 'packname_1=$(git pack-objects --window=0 test-1 <obj-list)' +test_expect_success \ + 'pack-objects with bogus arguments' \ + 'test_must_fail git pack-objects --window=0 test-1 blah blah <obj-list' + rm -fr .git2 mkdir .git2 |