Patrick Steinhardt <ps@xxxxxx> writes: > +expect_object_count () { > + find .git/objects \( -type d \( -name pack -o -name info \) -prune \) -o -type f -print >objects && > + test_line_count = "$1" objects > +} So this is counting "loose" objects. Do we want to have "loose" somewhere in its name? > +expect_object_in_idx () { > + git verify-pack -v "$1" >objects && > + test_grep "^$2" objects > +} And this one checks if an object exists in a given pack in somewhat an expensive way. It can take either .idx or .pack but the name makes the caller assume it should be called with .idx, which is OK. Would it achieve the same effect and be faster to do something like git show-index <"$1" >objects && test_grep "^[0-9]* $2 (" objects instead? Thanks.