builtin/read-tree: add --recurse-submodules switch

A new known failure mode is introduced[1], which is actually not
a failure but a feature in read-tree. Unlike checkout for which
the recursive submodule tests were originally written, read-tree does
warn about ignored untracked files that would be overwritten.
For the sake of keeping the test library for submodules generic, just
mark the test as a failure.

[1] KNOWN_FAILURE_SUBMODULE_OVERWRITE_IGNORED_UNTRACKED

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2017-03-14 14:46:42 -07:00
committed by Junio C Hamano
parent 1fc458d958
commit 25804914fa
4 changed files with 49 additions and 1 deletions

View File

@ -792,6 +792,11 @@ test_submodule_switch_recursing () {
then
RESULTR=failure
fi
RESULTOI=success
if test "$KNOWN_FAILURE_SUBMODULE_OVERWRITE_IGNORED_UNTRACKED" = 1
then
RESULTOI=failure
fi
######################### Appearing submodule #########################
# Switching to a commit letting a submodule appear checks it out ...
test_expect_success "$command: added submodule is checked out" '
@ -832,7 +837,7 @@ test_submodule_switch_recursing () {
)
'
# ... but an ignored file is fine.
test_expect_success "$command: added submodule removes an untracked ignored file" '
test_expect_$RESULTOI "$command: added submodule removes an untracked ignored file" '
test_when_finished "rm submodule_update/.git/info/exclude" &&
prolog &&
reset_work_tree_to_interested no_submodule &&