t4001: add a test comparing basename similarity and content similarity
[git/debian.git] / t / t4134-apply-submodule.sh
blobd1c16ba33c114477616d82d8e5d9fcbf53ed53ef
1 #!/bin/sh
3 # Copyright (c) 2010 Peter Collingbourne
6 test_description='git apply submodule tests'
8 . ./test-lib.sh
10 test_expect_success setup '
11 cat > create-sm.patch <<EOF &&
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 $(test_oid numeric)
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 $(test_oid numeric)
28 EOF
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
38 test_done