From: Junio C Hamano Date: Tue, 27 Dec 2022 23:17:28 GMT Subject: Re: [PATCH v4 6/6] tests: don't lose misc "git" exit codes Message-ID: In-Reply-To: <6efe13ea-8782-2337-1626-9687e2219680@dunelm.org.uk> Phillip Wood writes: >> - test -z "$(git diff file)" >> ... >> + git diff file >out && >> + test_must_be_empty out > > "git diff --exit-code file" would suffice here, we don't need to > redirect the output and check that it is empty. Yes, but the test is trying to be faithful to not just the intent but also the implementation of the original, I think.