git/t/t4137-apply-submodule.sh
Denton Liu aa06180ac9 lib-submodule-update: prepend "git" to $command
Since all invocations of test_submodule_forced_switch() are git
commands, automatically prepend "git" before invoking
test_submodule_switch_common().

Similarly, many invocations of test_submodule_switch() are also git
commands so automatically prepend "git" before invoking
test_submodule_switch_common() as well.

Finally, for invocations of test_submodule_switch() that invoke a custom
function, rename the old function to test_submodule_switch_func().

This is necessary because in a future commit, we will be adding some
logic that needs to distinguish between an invocation of a plain git
comamnd and an invocation of a test helper function.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-12 11:33:40 -07:00

21 lines
383 B
Bash
Executable file

#!/bin/sh
test_description='git apply handling submodules'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-submodule-update.sh
apply_index () {
git diff --ignore-submodules=dirty "..$1" | git apply --index -
}
test_submodule_switch_func "apply_index"
apply_3way () {
git diff --ignore-submodules=dirty "..$1" | git apply --3way -
}
test_submodule_switch_func "apply_3way"
test_done