From: Junio C Hamano Date: Mon, 03 Feb 2025 17:13:42 GMT Subject: Re: [PATCH 1/2] t7700: add tests for `--keep-unreachable` Message-ID: In-Reply-To: <20250203-b4-pks-repack-unreachable-objects-wo-packfiles-v1-1-7c4d69c5072c@pks.im> Patrick Steinhardt 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.