| # Copyright (c) 2010 Peter Collingbourne |
| test_description='git apply submodule tests' |
| test_expect_success setup ' |
| cat > create-sm.patch <<EOF && |
| diff --git a/dir/sm b/dir/sm |
| +Subproject commit 0123456789abcdef0123456789abcdef01234567 |
| cat > remove-sm.patch <<EOF |
| diff --git a/dir/sm b/dir/sm |
| -Subproject commit 0123456789abcdef0123456789abcdef01234567 |
| test_expect_success 'removing a submodule also removes all leading subdirectories' ' |
| git apply --index create-sm.patch && |
| git apply --index remove-sm.patch && |