summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a30134)
raw | patch | inline | side by side (parent: 6a30134)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Wed, 1 Feb 2012 15:17:19 +0000 (22:17 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 1 Feb 2012 21:04:11 +0000 (13:04 -0800) |
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>
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>
builtin/pack-objects.c | patch | blob | history | |
t/t5300-pack-object.sh | patch | blob | history |
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 297f7928518176361d58e7bf0fe2db261fe38e60..80e31145734c3c39aa7311c320c69a9f120539e0 100644 (file)
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
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 602806d09cda72c7bf0f407da35b2fb859404bd7..d9d856b87b2a896d4f80a3e62e6d1925b680a680 100755 (executable)
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
'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