3 # Copyright (c) 2010 Peter Collingbourne
6 test_description
='git apply submodule tests'
9 TEST_PASSES_SANITIZE_LEAK
=true
12 test_expect_success setup
'
13 cat > create-sm.patch <<EOF &&
14 diff --git a/dir/sm b/dir/sm
16 index 0000000..0123456
20 +Subproject commit $(test_oid numeric)
22 cat > remove-sm.patch <<EOF
23 diff --git a/dir/sm b/dir/sm
24 deleted file mode 160000
25 index 0123456..0000000
29 -Subproject commit $(test_oid numeric)
33 test_expect_success
'removing a submodule also removes all leading subdirectories' '
34 git apply --index create-sm.patch &&
36 git apply --index remove-sm.patch &&