]> git.ipfire.org Git - thirdparty/git.git/commit - t/t7001-mv.sh
mv: move submodules together with their work trees
authorJens Lehmann <Jens.Lehmann@web.de>
Tue, 30 Jul 2013 19:49:25 +0000 (21:49 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jul 2013 20:52:53 +0000 (13:52 -0700)
commit11502468287fdd62a22c43766881d21ab4fcf31c
treee09ccd628aee632890810c670c0bff8056e0a860
parent4838c81fabc2bab7ff5cd95135060d9a580ad742
mv: move submodules together with their work trees

Currently the attempt to use "git mv" on a submodule errors out with:

  fatal: source directory is empty, source=<src>, destination=<dest>

The reason is that mv searches for the submodule with a trailing slash in
the index, which it doesn't find (because it is stored without a trailing
slash). As it doesn't find any index entries inside the submodule it
claims the directory would be empty even though it isn't.

Fix that by searching for the name without a trailing slash and continue
if it is a submodule. Then rename() will move the submodule work tree just
like it moves a file.

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