]> git.ipfire.org Git - thirdparty/git.git/commit
t7300: assert exact states of repo
authorPatrick Steinhardt <ps@pks.im>
Thu, 2 Nov 2023 08:47:06 +0000 (09:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 23:37:07 +0000 (08:37 +0900)
commit390c5b07e2c2a1df515f0d9d9077f3ad2fe11f0b
tree693f74c2d184767bc60b55c826daf3f6ce658a11
parentc6429fb86765714ef35d789905c1c15f50c4de91
t7300: assert exact states of repo

Some of the tests in t7300 verify that git-clean(1) doesn't touch
repositories that are embedded into the main repository. This is done by
asserting a small set of substructures that are assumed to always exist,
like the "refs/", "objects/" or "HEAD". This has the downside that we
need to assume a specific repository structure that may be subject to
change when new backends for the refdb land. At the same time, we don't
thoroughly assert that git-clean(1) really didn't end up cleaning any
files in the repository either.

Convert the tests to instead assert that all files continue to exist
after git-clean(1) by comparing a file listing via find(1) before and
after executing clean. This makes our actual assertions stricter while
having to care less about the repository's actual on-disk format.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7300-clean.sh