3 test_description
='stash can handle submodules'
5 TEST_PASSES_SANITIZE_LEAK
=true
7 .
"$TEST_DIRECTORY"/lib-submodule-update.sh
10 git status
-su >expect
&&
12 may_only_be_test_must_fail
"$2" &&
13 $2 git read-tree
-u -m "$1" &&
19 git status
-su >actual
&&
21 test_cmp expect actual
&&
25 KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES
=1
26 KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT
=1
27 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR
=1
28 test_submodule_switch_func
"git_stash"
31 test_when_finished
"rm -rf main sub" &&
40 git
-c protocol.
file.allow
=always submodule add ..
/sub
&&
45 test_expect_success
'stash push with submodule.recurse=true preserves dirty submodule worktree' '
49 git config submodule.recurse true &&
50 echo "x" >main_file.t &&
51 echo "y" >sub/sub_file.t &&
53 test_must_fail git -C sub diff --quiet
57 test_expect_success
'stash push and pop with submodule.recurse=true preserves dirty submodule worktree' '
61 git config submodule.recurse true &&
62 echo "x" >main_file.t &&
63 echo "y" >sub/sub_file.t &&
66 test_must_fail git -C sub diff --quiet