From: Eric Sunshine Date: Sat, 30 Nov 2019 11:31:04 GMT Subject: Re: [PATCH v5 26/26] t7700: stop losing return codes of git commands Message-ID: In-Reply-To: <20191130104812.GA18401@danh.dev> On Sat, Nov 30, 2019 at 5:48 AM Danh Doan wrote: > On 2019-11-27 11:54:04-0800, Denton Liu wrote: > > + ! grep "^$coid " packlist && > > I think we want to use test_must_fail instead of ! test_must_fail() is intended only for use with 'git' commands; "!" should be used otherwise. Quoting from t/README: Don't use '! git cmd' when you want to make sure the git command exits with failure in a controlled way by calling "die()". Instead, use 'test_must_fail git cmd'. This will signal a failure if git dies in an unexpected way (e.g. segfault). On the other hand, don't use test_must_fail for running regular platform commands; just use '! cmd'. We are not in the business of verifying that the world given to us sanely works. So, Denton's use of "!" here is correct.