3 test_description='stash can handle submodules'
6 . "$TEST_DIRECTORY"/lib-submodule-update.sh
9 git status -su >expect &&
11 git read-tree -u -m "$1" &&
13 git status -su >actual &&
15 test_cmp expect actual &&
19 KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES=1
20 KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1
21 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
22 test_submodule_switch "git_stash"
25 test_when_finished "rm -rf main sub" &&
34 git submodule add ../sub &&
39 test_expect_success 'stash push with submodule.recurse=true preserves dirty submodule worktree' '
43 git config submodule.recurse true &&
44 echo "x" >main_file.t &&
45 echo "y" >sub/sub_file.t &&
47 test_must_fail git -C sub diff --quiet
51 test_expect_success 'stash push and pop with submodule.recurse=true preserves dirty submodule worktree' '
55 git config submodule.recurse true &&
56 echo "x" >main_file.t &&
57 echo "y" >sub/sub_file.t &&
60 test_must_fail git -C sub diff --quiet