summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Stefan Beller <sbeller@google.com>2017-03-14 14:46:42 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-16 14:07:16 -0700
commit25804914fa3661549cb4017fd0d127b9b626fc69 (patch)
tree5262186d86d313cb0a66b369504f7f3d04212ccb /t
parentbuiltin/checkout: add --recurse-submodules switch (diff)
downloadtgif-25804914fa3661549cb4017fd0d127b9b626fc69.tar.xz
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>
Diffstat (limited to 't')
-rwxr-xr-xt/lib-submodule-update.sh7
-rwxr-xr-xt/t1013-read-tree-submodule.sh8
2 files changed, 14 insertions, 1 deletions
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
index 4e775a38b6..fb4f7b014e 100755
--- a/t/lib-submodule-update.sh
+++ b/t/lib-submodule-update.sh
@@ -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 &&
diff --git a/t/t1013-read-tree-submodule.sh b/t/t1013-read-tree-submodule.sh
index 20526aed34..de1ba02dc5 100755
--- a/t/t1013-read-tree-submodule.sh
+++ b/t/t1013-read-tree-submodule.sh
@@ -5,6 +5,14 @@ test_description='read-tree can handle submodules'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-submodule-update.sh
+KNOWN_FAILURE_SUBMODULE_RECURSIVE_NESTED=1
+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"