From: Phillip Wood Date: Tue, 27 Dec 2022 16:40:25 GMT Subject: Re: [PATCH v4 2/6] t/lib-patch-mode.sh: fix ignored exit codes Message-ID: In-Reply-To: Hi Ævar On 19/12/2022 10:19, Ævar Arnfjörð Bjarmason wrote: > 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 > @@ -46,5 +50,6 @@ save_head () { > } > > verify_saved_head () { > - test "$(cat _head)" = "$(git rev-parse HEAD)" > + git rev-parse HEAD >actual && > + test_cmp _head actual Aren't these two lines are re-implementing test_cmp_rev()? Best Wishes Phillip