summaryrefslogtreecommitdiff
path: root/t/t3600-rm.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2014-01-07 21:32:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-07 22:34:06 (GMT)
commitbbad9f9314f658b5c0f302148fc9780f5788dcd8 (patch)
tree9c1c6f25614f987ddeb45bba0e748035e888fbd7 /t/t3600-rm.sh
parent1cbd18300a8755ba46791b2aa6249fa537a1d651 (diff)
downloadgit-bbad9f9314f658b5c0f302148fc9780f5788dcd8.zip
git-bbad9f9314f658b5c0f302148fc9780f5788dcd8.tar.gz
git-bbad9f9314f658b5c0f302148fc9780f5788dcd8.tar.bz2
rm: better document side effects when removing a submodule
The "Submodules" section of the "git rm" documentation mentions what will happen when a submodule with a gitfile gets removed with newer git. But it doesn't talk about what happens when the user changes between commits before and after the removal, which does not remove the submodule from the work tree like using the rm command did the first time. Explain what happens and what the user has to do manually to fix that in the new BUGS section. Also document this behavior in a new test. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3600-rm.sh')
-rwxr-xr-xt/t3600-rm.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 540c49b..3d30581 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -705,6 +705,22 @@ test_expect_success 'rm of a populated nested submodule with a nested .git direc
rm -rf submod
'
+test_expect_success 'checking out a commit after submodule removal needs manual updates' '
+ git commit -m "submodule removal" submod &&
+ git checkout HEAD^ &&
+ git submodule update &&
+ git checkout -q HEAD^ 2>actual &&
+ git checkout -q master 2>actual &&
+ echo "warning: unable to rmdir submod: Directory not empty" >expected &&
+ test_i18ncmp expected actual &&
+ git status -s submod >actual &&
+ echo "?? submod/" >expected &&
+ test_cmp expected actual &&
+ rm -rf submod &&
+ git status -s -uno --ignore-submodules=none > actual &&
+ ! test -s actual
+'
+
test_expect_success 'rm of d/f when d has become a non-directory' '
rm -rf d &&
mkdir d &&