git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/3] pack-objects: do not accept "--index-version=version,"

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 1, 2012, 15:17 UTC
Message-ID
<1328109440-9510-1-git-send-email-pclouds@gmail.com>
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
Previous: Nguyen Thai Ngoc DuyNext: Nguyễn Thái Ngọc Duy
Message 5 of 8 in “pack-objects: convert to use parse_options()”
  1. pack-objects: convert to use parse_options()Nguyễn Thái Ngọc Duy, Jan 31, 2012
  2. Junio C HamanoJan 31, 2012
  3. Nguyen Thai Ngoc DuyFeb 1, 2012
  4. Nguyen Thai Ngoc DuyFeb 1, 2012
  5. 1/3 pack-objects: do not accept "--index-version=version,"Nguyễn Thái Ngọc Duy, Feb 1, 2012
  6. 2/3 pack-objects: remove bogus commentNguyễn Thái Ngọc Duy, Feb 1, 2012
  7. 3/3 pack-objects: convert to use parse_options()Nguyễn Thái Ngọc Duy, Feb 1, 2012
  8. Junio C HamanoFeb 3, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.