Shift object enumeration out of upload-pack

Offload object enumeration in upload-pack to pack-objects, but fall
back on internal revision walker for shallow interaction.   Aside from
architecturally making more sense, this also leaves the door open for
pack-objects to employ a revision cache mechanism.  Test t5530 updated
in order to explicitly check both enumeration methods.

Signed-off-by: Nick Edelen <sirnot@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nick Edelen
2009-06-10 01:50:18 +02:00
committed by Junio C Hamano
parent f4f78e668d
commit f0cea83f63
2 changed files with 51 additions and 12 deletions

View File

@ -30,11 +30,12 @@ test_expect_success 'fsck fails' '
test_must_fail git fsck
'
test_expect_success 'upload-pack fails due to error in pack-objects' '
test_expect_success 'upload-pack fails due to error in pack-objects packing' '
! echo "0032want $(git rev-parse HEAD)
00000009done
0000" | git upload-pack . > /dev/null 2> output.err &&
grep "unable to read" output.err &&
grep "pack-objects died" output.err
'
@ -51,11 +52,20 @@ test_expect_success 'fsck fails' '
test_expect_success 'upload-pack fails due to error in rev-list' '
! echo "0032want $(git rev-parse HEAD)
00000009done
0034shallow $(git rev-parse HEAD^)00000009done
0000" | git upload-pack . > /dev/null 2> output.err &&
grep "waitpid (async) failed" output.err
'
test_expect_success 'upload-pack fails due to error in pack-objects enumeration' '
! echo "0032want $(git rev-parse HEAD)
00000009done
0000" | git upload-pack . > /dev/null 2> output.err &&
grep "bad tree object" output.err &&
grep "pack-objects died" output.err
'
test_expect_success 'create empty repository' '
mkdir foo &&