Thread (1 message) 1 message, 1 author, 2025-02-03

Re: [PATCH 1/2] t7700: add tests for `--keep-unreachable`

From: Junio C Hamano <hidden>
Date: 2025-02-03 17:13:45

Patrick Steinhardt [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help