3 test_description='stash can handle submodules'
6 . "$TEST_DIRECTORY"/lib-submodule-update.sh
9 git status -su >expect &&
11 may_only_be_test_must_fail "$2" &&
12 $2 git read-tree -u -m "$1" &&
18 git status -su >actual &&
20 test_cmp expect actual &&
24 KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES=1
25 KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1
26 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
27 test_submodule_switch_func "git_stash"
30 test_when_finished "rm -rf main sub" &&
39 git submodule add ../sub &&
44 test_expect_success 'stash push with submodule.recurse=true preserves dirty submodule worktree' '
48 git config submodule.recurse true &&
49 echo "x" >main_file.t &&
50 echo "y" >sub/sub_file.t &&
52 test_must_fail git -C sub diff --quiet
56 test_expect_success 'stash push and pop with submodule.recurse=true preserves dirty submodule worktree' '
60 git config submodule.recurse true &&
61 echo "x" >main_file.t &&
62 echo "y" >sub/sub_file.t &&
65 test_must_fail git -C sub diff --quiet