Skip to content

Commit 03b0500

Browse files
derrickstoleeKevin Willford
authored and
Kevin Willford
committed
midx: predict packfile name size using wc
Signed-off-by: Derrick Stolee <[email protected]>
1 parent 3b40c7e commit 03b0500

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t5319-midx.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ MIDX_BYTE_OBJECT_OFFSET=`expr $MIDX_OFFSET_OBJECT_OFFSETS + \
262262
MIDX_OFFSET_PACKFILE_NAMES=`expr $MIDX_OFFSET_OBJECT_OFFSETS + \
263263
$MIDX_WIDTH_OBJECT_OFFSETS \* $MIDX_NUM_OBJECTS`
264264
MIDX_BYTE_PACKFILE_NAMES=`expr $MIDX_OFFSET_PACKFILE_NAMES + 10`
265-
MIDX_LEN=$(stat --printf="%s" midx-*.midx)
266-
MIDX_BYTE_CHECKSUM=`expr $MIDX_LEN - $HASH_LEN`
265+
MIDX_PACKNAME_SIZE=`expr $(ls *.pack | wc -c) + $MIDX_NUM_PACKS`
266+
MIDX_BYTE_CHECKSUM=`expr $MIDX_OFFSET_PACKFILE_NAMES + $MIDX_PACKNAME_SIZE`
267267

268268
test_expect_success 'midx --verify succeeds' '
269269
git midx --verify --pack-dir .

0 commit comments

Comments
 (0)