summaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
authorLibravatar Peter Collingbourne <peter@pcc.me.uk>2010-01-11 02:59:54 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-01-11 19:50:51 -0800
commitc5e558a80ad27774b9984258a31fbf46a1d7c152 (patch)
tree52f49eeac0af719a6cfd5312f3a6903808663461 /t/t7400-submodule-basic.sh
parentGit 1.6.6 (diff)
downloadtgif-c5e558a80ad27774b9984258a31fbf46a1d7c152.tar.xz
Remove empty directories when checking out a commit with fewer submodules
Change the unlink_entry function to use rmdir to remove submodule directories. Currently we try to use unlink, which will never succeed. Of course rmdir will only succeed for empty (i.e. not checked out) submodule directories. Behaviour if a submodule is checked out stays essentially the same: print a warning message and keep the submodule directory. Signed-off-by: Peter Collingbourne <peter@pcc.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index a0cc99ab9f..1a4dc5f893 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -299,6 +299,15 @@ test_expect_success 'ls-files gracefully handles trailing slash' '
'
+test_expect_success 'moving to a commit without submodule does not leave empty dir' '
+ rm -rf init &&
+ mkdir init &&
+ git reset --hard &&
+ git checkout initial &&
+ test ! -d init &&
+ git checkout second
+'
+
test_expect_success 'submodule <invalid-path> warns' '
git submodule no-such-submodule 2> output.err &&