3 test_description
='revert can handle submodules'
5 TEST_PASSES_SANITIZE_LEAK
=true
7 .
"$TEST_DIRECTORY"/lib-submodule-update.sh
9 # Create a revert that moves from HEAD (including any test modifications to
10 # the work tree) to $1 by first checking out $1 and reverting it. Reverting
11 # the revert is the transition we test for. We tar the current work tree
12 # first so we can restore the work tree test setup after doing the checkout
13 # and revert. We test here that the restored work tree content is identical
14 # to that at the beginning. The last revert is then tested by the framework.
16 git status
-su >expect
&&
18 "$TAR" cf
"$TRASH_DIRECTORY/tmp.tar" * &&
19 may_only_be_test_must_fail
"$2" &&
20 $2 git checkout
"$1" &&
27 "$TAR" xf
"$TRASH_DIRECTORY/tmp.tar" &&
28 git status
-su >actual
&&
30 test_cmp expect actual
&&
34 if test "$GIT_TEST_MERGE_ALGORITHM" != ort
36 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR
=1
38 test_submodule_switch_func
"git_revert"