Skip to content

Commit 3612c23

Browse files
derrickstoleegitster
authored andcommitted
t5319: use 'test-tool path-utils' instead of 'ls -l'
Using 'ls -l' and parsing the columns to find file sizes is problematic when the platform could report the owner as a name with spaces. Instead, use the 'test-tool path-utils file-size' command to list only the sizes. Reported-by: Johannes Sixt <[email protected]> Helped-by: Johannes Schindelin <[email protected]> Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b526d8c commit 3612c23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t5319-multi-pack-index.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ test_expect_success 'repack with minimum size does not alter existing packs' '
443443
touch -m -t 201901010002 .git/objects/pack/pack-B* &&
444444
touch -m -t 201901010003 .git/objects/pack/pack-A* &&
445445
ls .git/objects/pack >expect &&
446-
MINSIZE=$(ls -l .git/objects/pack/*pack | awk "{print \$5;}" | sort -n | head -n 1) &&
446+
MINSIZE=$(test-tool path-utils file-size .git/objects/pack/*pack | sort -n | head -n 1) &&
447447
git multi-pack-index repack --batch-size=$MINSIZE &&
448448
ls .git/objects/pack >actual &&
449449
test_cmp expect actual
@@ -455,7 +455,7 @@ test_expect_success 'repack creates a new pack' '
455455
cd dup &&
456456
ls .git/objects/pack/*idx >idx-list &&
457457
test_line_count = 5 idx-list &&
458-
THIRD_SMALLEST_SIZE=$(ls -l .git/objects/pack/*pack | awk "{print \$5;}" | sort -n | head -n 3 | tail -n 1) &&
458+
THIRD_SMALLEST_SIZE=$(test-tool path-utils file-size .git/objects/pack/*pack | sort -n | head -n 3 | tail -n 1) &&
459459
BATCH_SIZE=$(($THIRD_SMALLEST_SIZE + 1)) &&
460460
git multi-pack-index repack --batch-size=$BATCH_SIZE &&
461461
ls .git/objects/pack/*idx >idx-list &&

0 commit comments

Comments
 (0)