blob: 07d52625375d4bec97db0a14d74a4fd154681b5e [file] [log] [blame]
Jens Lehmann558643e2014-06-15 18:59:20 +02001#!/bin/sh
2
3test_description='git apply handling submodules'
4
5. ./test-lib.sh
6. "$TEST_DIRECTORY"/lib-submodule-update.sh
7
8apply_index () {
Denton Liu5b0ac092020-06-24 04:50:18 -04009 git diff --ignore-submodules=dirty "..$1" >diff &&
10 may_only_be_test_must_fail "$2" &&
11 $2 git apply --index diff
Jens Lehmann558643e2014-06-15 18:59:20 +020012}
13
Denton Liuaa061802020-06-11 13:41:49 -040014test_submodule_switch_func "apply_index"
Jens Lehmann558643e2014-06-15 18:59:20 +020015
16apply_3way () {
Denton Liu5b0ac092020-06-24 04:50:18 -040017 git diff --ignore-submodules=dirty "..$1" >diff &&
18 may_only_be_test_must_fail "$2" &&
19 $2 git apply --3way diff
Jens Lehmann558643e2014-06-15 18:59:20 +020020}
21
Denton Liuaa061802020-06-11 13:41:49 -040022test_submodule_switch_func "apply_3way"
Jens Lehmann558643e2014-06-15 18:59:20 +020023
24test_done