From 5aed3c6ab834367292bd7a9b0894177a07afd910 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 4 Feb 2009 10:32:08 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- t/t7001-mv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t7001-mv.sh') diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index ef7e56ed63..d2ec550af6 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -58,7 +58,7 @@ test_expect_success \ test ! -f path0/untracked1 && test ! -f path0/untracked2' -test_expect_failure \ +test_expect_success \ 'checking -f on untracked file with existing target' \ 'touch path0/untracked1 && git mv -f untracked1 path0 -- cgit v1.2.1