]> git.ipfire.org Git - thirdparty/git.git/commit - advice.h
tracking branches: add advice to ambiguous refspec error
authorTao Klerks <tao@klerks.biz>
Fri, 1 Apr 2022 06:05:13 +0000 (06:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Apr 2022 17:09:18 +0000 (10:09 -0700)
commite4921d877ab3487fbc0bde8b3e59b757d274783c
tree720185c5bb3e315fff585865008a03b055c28a7c
parentabf474a5dd901f28013c52155411a48fd4c09922
tracking branches: add advice to ambiguous refspec error

The error "not tracking: ambiguous information for ref" is raised
when we are evaluating what tracking information to set on a branch,
and find that the ref to be added as tracking branch is mapped
under multiple remotes' fetch refspecs.

This can easily happen when a user copy-pastes a remote definition
in their git config, and forgets to change the tracking path.

Add advice in this situation, explicitly highlighting which remotes
are involved and suggesting how to correct the situation. Also
update a test to explicitly expect that advice.

Signed-off-by: Tao Klerks <tao@klerks.biz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/advice.txt
advice.c
advice.h
branch.c
t/t3200-branch.sh