git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH v2 1/3] pack-objects: do not accept "--index-version=version,"
Date: Wed,  1 Feb 2012 22:17:18 +0700	[thread overview]
Message-ID: <1328109440-9510-1-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1328017702-14489-1-git-send-email-pclouds@gmail.com>


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/pack-objects.c |    2 +-
 t/t5302-pack-index.sh  |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0f2e7b8..297f792 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2471,7 +2471,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 			pack_idx_opts.version = strtoul(arg + 16, &c, 10);
 			if (pack_idx_opts.version > 2)
 				die("bad %s", arg);
-			if (*c == ',')
+			if (*c == ',' && c[1])
 				pack_idx_opts.off32_limit = strtoul(c+1, &c, 0);
 			if (*c || pack_idx_opts.off32_limit & 0x80000000)
 				die("bad %s", arg);
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index f8fa924..fe82025 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -74,6 +74,10 @@ test_expect_success 'index-pack --verify on index version 2' '
 '
 
 test_expect_success \
+    'pack-objects --index-version=2, is not accepted' \
+    'test_must_fail git pack-objects --index-version=2, test-3 <obj-list'
+
+test_expect_success \
     'index v2: force some 64-bit offsets with pack-objects' \
     'pack3=$(git pack-objects --index-version=2,0x40000 test-3 <obj-list)'
 
-- 
1.7.8.36.g69ee2

  parent reply	other threads:[~2012-02-01 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 13:48 [PATCH] pack-objects: convert to use parse_options() Nguyễn Thái Ngọc Duy
2012-01-31 23:29 ` Junio C Hamano
2012-02-01 14:30   ` Nguyen Thai Ngoc Duy
2012-02-01 14:49     ` Nguyen Thai Ngoc Duy
2012-02-01 15:17 ` Nguyễn Thái Ngọc Duy [this message]
2012-02-01 15:17   ` [PATCH v2 2/3] pack-objects: remove bogus comment Nguyễn Thái Ngọc Duy
2012-02-01 15:17   ` [PATCH v2 3/3] pack-objects: convert to use parse_options() Nguyễn Thái Ngọc Duy
2012-02-03  0:31   ` [PATCH v2 1/3] pack-objects: do not accept "--index-version=version," Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328109440-9510-1-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).