| test_description='checkout can handle submodules' |
| test_expect_success 'setup' ' |
| git commit -m superproject && |
| git commit -m updated.superproject |
| test_expect_success '"reset <submodule>" updates the index' ' |
| git update-index --refresh && |
| git diff-files --quiet && |
| git diff-index --quiet --cached HEAD && |
| test_must_fail git reset HEAD^ submodule && |
| test_must_fail git diff-files --quiet && |
| test_expect_success '"checkout <submodule>" updates the index only' ' |
| git update-index --refresh && |
| git diff-files --quiet && |
| git diff-index --quiet --cached HEAD && |
| git checkout HEAD^ submodule && |
| test_must_fail git diff-files --quiet && |
| git checkout HEAD submodule && |