From: Junio C Hamano Date: Mon, 10 Jul 2023 21:35:19 GMT Subject: Re: [PATCH 2/2] builtin/repack.c: avoid dir traversal in `collect_pack_filenames()` Message-ID: In-Reply-To: Taylor Blau writes: > However, manually enumerating a repository's packs via `readdir()` is > confusing and error-prone. It leads to frustrating inconsistencies > between which packs Git considers to be part of a repository (i.e., > could be found in the list of packs from `get_all_packs()`), and which > packs `collect_pack_filenames()` considers to meet the same criteria. Makes sense. > One gotcha here is that we have to ignore non-local packs, since the > original version of `collect_pack_filenames()` only looks at the local > pack directory to collect existing packs. Yup. Does this "fix" anything, or just makes the resulting code clearer and protects it from future breakage? I think it is the latter and not having any test is justified. Thanks.