summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 828ea97)
raw | patch | inline | side by side (parent: 828ea97)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Wed, 1 Feb 2012 15:17:18 +0000 (22:17 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 1 Feb 2012 21:03:46 +0000 (13:03 -0800) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c | patch | blob | history | |
t/t5302-pack-index.sh | patch | blob | history |
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0f2e7b8f5cb26910679c39550d59ef23353a278f..297f7928518176361d58e7bf0fe2db261fe38e60 100644 (file)
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
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 f8fa92446cfc46309468b4ecf142b74b1a812985..fe82025d4a0dbae0cee3d0c3943617ede5b5c7a5 100755 (executable)
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
git index-pack --verify "test-2-${pack2}.pack"
'
+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)'