Re: [PATCH v4 22/27] t7700: consolidate code into test_no_missing_in_packs()
On Mon, Nov 25, 2019 at 8:21 PM Denton Liu <liu.denton@gmail.com> wrote:
Show 14 quoted lines
> The code to test that objects were not missing from the packfile was
> duplicated many times. Extract the duplicated code into
> test_no_missing_in_packs() and use that instead.
>
> Refactor the resulting extraction so that if any git commands fail,
> their return codes are not silently lost.
>
> We were using sed to filter lines. Although not incorrect, this is
> exactly what grep is built for. Replace this invocation of sed with grep
> so that we use the correct tool for the job.
>
> The original testing construct was O(n^2): it used a grep in a loop to
> test whether any objects were missing in the packfile. Rewrite this to
> use sort the files then use `comm -23` so that finding missing lines
Show 5 quoted lines
> from the original file is done more efficiently.
>
> While we're at it, add a space to `commit_and_pack ()` for style.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>