Re: [PATCH v4 2/6] t/lib-patch-mode.sh: fix ignored exit codes
Hi Ævar
On 19/12/2022 10:19, Ævar Arnfjörð Bjarmason wrote:
Show 18 quoted lines
> Fix code added in b319ef70a94 (Add a small patch-mode testing library,
> 2009-08-13) to use &&-chaining.
>
> This avoids losing both the exit code of a "git" and the "cat"
> processes.
>
> This fixes cases where we'd have e.g. missed memory leaks under
> SANITIZE=leak, this code doesn't leak now as far as I can tell, but I
> discovered it while looking at leaks in related code.
> [...]
> # verify_saved_state <path>
> @@ -46,5 +50,6 @@ save_head () {
> }
>
> verify_saved_head () {
> - test "$(cat _head)" = "$(git rev-parse HEAD)"
> + git rev-parse HEAD >actual &&
> + test_cmp _head actualAren't these two lines are re-implementing test_cmp_rev()?
Best Wishes
Phillip