On Sat, Jun 2, 2018 at 7:50 AM, Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > Introduce a checkout.defaultRemote setting which can be used to > designate a remote to prefer (via checkout.defaultRemote=origin) when > running e.g. "git checkout master" to mean origin/master, even though > there's other remotes that have the "master" branch. > [...] > Also adjust the advice.checkoutAmbiguousRemoteBranchName message to > mention this new config setting to the user, the full output on my > git.git is now (the last paragraph is new): > > $ ./git --exec-path=$PWD checkout master > error: pathspec 'master' did not match any file(s) known to git. > hint: The argument 'master' matched more than one remote tracking branch. In v6, the "The argument" prefix has been dropped from the hint, so this commit message needs a tweak to match. > hint: We found 26 remotes with a reference that matched. So we fell back > hint: on trying to resolve the argument as a path, but failed there too! > [...] > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> > --- > diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh > @@ -87,7 +87,23 @@ test_expect_success 'checkout of branch from multiple remotes fails with advice' > - test_i18ngrep ! "^hint: " stderr > + test_i18ngrep ! "^hint: " stderr && > + # Make sure the likes of checkout -p don not print this hint s/don/do/ > + git checkout -p foo 2>stderr && > + test_i18ngrep ! "^hint: " stderr && > + status_uno_is_clean > +'