Code

git-mv: fix directory separator treatment on Windows
authorJohannes Sixt <j6t@kdbg.org>
Tue, 30 Jun 2009 13:33:57 +0000 (15:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jun 2009 18:23:21 +0000 (11:23 -0700)
commitb8f262699f6c527b13ff95a322fafc0bfbc5a232
treea83bb6f0560f27079b319044c329d20c13ef8f52
parent6fac1b83bdb9aee73363f93874ffaffd1bc3ad5c
git-mv: fix directory separator treatment on Windows

The following invocations did not work as expected on Windows:

    git mv foo\bar dest
    git mv foo\ dest

The first command was interpreted as

    git mv foo/bar dest/foo/bar

because the Windows style directory separator was not obeyed when the
basename of 'foo\bar' was computed.

The second command failed because the Windows style directory separator was
not removed from the source directory, whereupon the lookup of the
directory in the index failed.

This fixes both issues by using is_dir_sep() and basename().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-mv.c