branch: warn and refuse to set a branch as a tracking branch of itself.
commit85e2233f982f760d0e731b1258da2580834d8027
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Mon, 18 Jan 2010 20:44:12 +0000 (18 22:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Jan 2010 01:46:28 +0000 (18 17:46 -0800)
treec15768a5e545300805a05eef92d75ae75c264386
parent4fc500667636c4ada592a40c4d11ce0560c43c0d
branch: warn and refuse to set a branch as a tracking branch of itself.

Previous patch allows commands like "git branch --set-upstream foo foo",
which doesn't make much sense. Warn the user and don't change the
configuration in this case. Don't die to let the caller finish its job in
such case.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c