Jens Lehmann | 558643e | 2014-06-15 18:59:20 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='git apply handling submodules' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | . "$TEST_DIRECTORY"/lib-submodule-update.sh |
| 7 | |
| 8 | apply_index () { |
Denton Liu | 5b0ac09 | 2020-06-24 04:50:18 -0400 | [diff] [blame] | 9 | git diff --ignore-submodules=dirty "..$1" >diff && |
| 10 | may_only_be_test_must_fail "$2" && |
| 11 | $2 git apply --index diff |
Jens Lehmann | 558643e | 2014-06-15 18:59:20 +0200 | [diff] [blame] | 12 | } |
| 13 | |
Denton Liu | aa06180 | 2020-06-11 13:41:49 -0400 | [diff] [blame] | 14 | test_submodule_switch_func "apply_index" |
Jens Lehmann | 558643e | 2014-06-15 18:59:20 +0200 | [diff] [blame] | 15 | |
| 16 | apply_3way () { |
Denton Liu | 5b0ac09 | 2020-06-24 04:50:18 -0400 | [diff] [blame] | 17 | git diff --ignore-submodules=dirty "..$1" >diff && |
| 18 | may_only_be_test_must_fail "$2" && |
| 19 | $2 git apply --3way diff |
Jens Lehmann | 558643e | 2014-06-15 18:59:20 +0200 | [diff] [blame] | 20 | } |
| 21 | |
Denton Liu | aa06180 | 2020-06-11 13:41:49 -0400 | [diff] [blame] | 22 | test_submodule_switch_func "apply_3way" |
Jens Lehmann | 558643e | 2014-06-15 18:59:20 +0200 | [diff] [blame] | 23 | |
| 24 | test_done |