git-commit-vandalism/t/t1013-read-tree-submodule.sh
Stefan Beller 218c883783 submodule: properly recurse for read-tree and checkout
We forgot to prepare the submodule env, which is only a problem for
nested submodules. See 2e5d6503bd (ls-files: fix recurse-submodules
with nested submodules, 2017-04-13) for further explanation.

To come up with a proper test for this, we'd need to look at nested
submodules just as in that given commit. It turns out we're lucky
and these tests already exist, but are marked as failing. We need
to pass `--recurse-submodules` to read-tree additionally to make
these tests pass. Passing that flag alone would not make the tests
pass, such that this covers testing for the bug fix of the submodule
env as well.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-04 13:42:05 +09:00

20 lines
501 B
Bash
Executable File

#!/bin/sh
test_description='read-tree can handle submodules'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-submodule-update.sh
KNOWN_FAILURE_DIRECTORY_SUBMODULE_CONFLICTS=1
KNOWN_FAILURE_SUBMODULE_OVERWRITE_IGNORED_UNTRACKED=1
test_submodule_switch_recursing "git read-tree --recurse-submodules -u -m"
test_submodule_forced_switch_recursing "git read-tree --recurse-submodules -u --reset"
test_submodule_switch "git read-tree -u -m"
test_submodule_forced_switch "git read-tree -u --reset"
test_done