pack-objects: remove bogus comment

The comment was introduced in b5d97e6 (pack-objects: run rev-list equivalent internally. - 2006-09-04), stating that git pack-objects [options] base-name <refs...> is acceptable and refs should be passed into rev-list. But that's not true. All arguments after base-name are ignored. Remove the comment and reject this syntax (i.e. no more arguments after base name) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Feb 1, 2012 at 22:17 UTC 3a2ec52e99deabbf000cb576ccde73a12934bf60
2 files changed +5 -14
builtin/pack-objects.c
+1 -14
@@ -2484,23 +2484,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
2484 usage(pack_usage);
2485 }
2486
2487 - /* Traditionally "pack-objects [options] base extra" failed;
2488 - * we would however want to take refs parameter that would
2489 - * have been given to upstream rev-list ourselves, which means
2490 - * we somehow want to say what the base name is. So the
2491 - * syntax would be:
2492 - *
2493 - * pack-objects [options] base <refs...>
2494 - *
2495 - * in other words, we would treat the first non-option as the
2496 - * base_name and send everything else to the internal revision
2497 - * walker.
2498 - */
2499 -
2487 if (!pack_to_stdout)
2488 base_name = argv[i++];
2489
2503 - if (pack_to_stdout != !base_name)
2490 + if (pack_to_stdout != !base_name || argv[i])
2491 usage(pack_usage);
2492
2493 if (!pack_to_stdout && !pack_size_limit)
t/t5300-pack-object.sh
+4
@@ -38,6 +38,10 @@ test_expect_success \
38 'pack without delta' \
39 'packname_1=$(git pack-objects --window=0 test-1 <obj-list)'
40
41 +test_expect_success \
42 + 'pack-objects with bogus arguments' \
43 + 'test_must_fail git pack-objects --window=0 test-1 blah blah <obj-list'
44 +
45 rm -fr .git2
46 mkdir .git2
47