]>
Commit | Line | Data |
---|---|---|
80d706af PC |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2010 Peter Collingbourne | |
4 | # | |
5 | ||
6 | test_description='git apply submodule tests' | |
7 | ||
8 | . ./test-lib.sh | |
9 | ||
10 | test_expect_success setup ' | |
a48fcd83 | 11 | cat > create-sm.patch <<EOF && |
80d706af PC |
12 | diff --git a/dir/sm b/dir/sm |
13 | new file mode 160000 | |
14 | index 0000000..0123456 | |
15 | --- /dev/null | |
16 | +++ b/dir/sm | |
17 | @@ -0,0 +1 @@ | |
18 | +Subproject commit 0123456789abcdef0123456789abcdef01234567 | |
19 | EOF | |
20 | cat > remove-sm.patch <<EOF | |
21 | diff --git a/dir/sm b/dir/sm | |
22 | deleted file mode 160000 | |
23 | index 0123456..0000000 | |
24 | --- a/dir/sm | |
25 | +++ /dev/null | |
26 | @@ -1 +0,0 @@ | |
27 | -Subproject commit 0123456789abcdef0123456789abcdef01234567 | |
28 | EOF | |
29 | ' | |
30 | ||
31 | test_expect_success 'removing a submodule also removes all leading subdirectories' ' | |
32 | git apply --index create-sm.patch && | |
33 | test -d dir/sm && | |
34 | git apply --index remove-sm.patch && | |
35 | test \! -d dir | |
36 | ' | |
37 | ||
38 | test_done |