Code

builtin-mv: minimum fix to avoid losing files
authorJunio C Hamano <gitster@pobox.com>
Mon, 4 Feb 2008 07:59:17 +0000 (23:59 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Feb 2008 08:44:10 +0000 (00:44 -0800)
commit744dacd3f5045240a304e687f3ef7135398e7865
tree2f79230a6d792514f78c9344661158f1b6b19b5a
parent1abf0950638d4f3279d059a1365da9c253d5718a
builtin-mv: minimum fix to avoid losing files

An incorrect command "git mv subdir /outer/space" threw the
subdirectory to outside of the repository and then noticed that
/outer/space/subdir/ would be outside of the repository.  The
error checking is backwards.

This fixes the issue by being careful about use of the return
value of get_pathspec().  Since the implementation already has
handcrafted loop to munge each path on the command line, we use
prefix_path() instead.

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