From: Alexandr Miloslavskiy Date: Wed, 27 Nov 2019 16:42:58 GMT Subject: Re: [PATCH 2/2] checkout: die() on ambiguous tracking branches Message-ID: <94480425-1827-48d6-b7d7-966acc536c6c@syntevo.com> In-Reply-To: On 27.11.2019 15:46, Derrick Stolee wrote: >> + if (!remote && (num_matches > 1)) { > > I believe the parentheses around "num_matched > 1" are not needed here. Fixed in v2. > I like that you added a test for this non-obvious situation. One thing that > would help ensure that your test is checking the right thing is to redirect > stderr to a file and grep for the die() message you included. Something like: > > test_must_fail git checkout ambiguous_branch_and_file 2>err && > test_i18ngrep "matched multiple (2) remote tracking branches" err && This is a good idea, thanks! Added in v2.