mirror of
https://github.com/git/git
synced 2024-11-05 01:58:18 +00:00
f54f48fc07
Mark some tests that match "*apply*" as passing when git is compiled with SANITIZE=leak. They'll now be listed as running under the "GIT_TEST_PASSING_SANITIZE_LEAK=true" test mode (the "linux-leaks" CI target). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
40 lines
770 B
Bash
Executable file
40 lines
770 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2010 Peter Collingbourne
|
|
#
|
|
|
|
test_description='git apply submodule tests'
|
|
|
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success setup '
|
|
cat > create-sm.patch <<EOF &&
|
|
diff --git a/dir/sm b/dir/sm
|
|
new file mode 160000
|
|
index 0000000..0123456
|
|
--- /dev/null
|
|
+++ b/dir/sm
|
|
@@ -0,0 +1 @@
|
|
+Subproject commit $(test_oid numeric)
|
|
EOF
|
|
cat > remove-sm.patch <<EOF
|
|
diff --git a/dir/sm b/dir/sm
|
|
deleted file mode 160000
|
|
index 0123456..0000000
|
|
--- a/dir/sm
|
|
+++ /dev/null
|
|
@@ -1 +0,0 @@
|
|
-Subproject commit $(test_oid numeric)
|
|
EOF
|
|
'
|
|
|
|
test_expect_success 'removing a submodule also removes all leading subdirectories' '
|
|
git apply --index create-sm.patch &&
|
|
test -d dir/sm &&
|
|
git apply --index remove-sm.patch &&
|
|
test \! -d dir
|
|
'
|
|
|
|
test_done
|