builtin-mv.c: check for unversionned files before looking at the destination.
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Wed, 4 Feb 2009 09:32:08 +0000 (10:32 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Feb 2009 19:07:42 +0000 (11:07 -0800)
commit5aed3c6ab834367292bd7a9b0894177a07afd910
tree4be58af9c9128aa8f1ff36e07f55857559c1456b
parentc8ba6b1b199bf00f227e8fdad4adb5a2147c8160
builtin-mv.c: check for unversionned files before looking at the destination.

The previous code was failing in the case where one moves an
unversionned file to an existing destination, with mv -f: the
"existing destination" was checked first, and the error was cancelled
by the force flag.

We now check the unrecoverable error first, which fixes the bug.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-mv.c
t/t7001-mv.sh