| test_description='sparse checkout scope tests' |
| test_expect_success 'setup' ' |
| git commit -m "initial commit" |
| test_expect_success 'create feature branch' ' |
| git checkout -b feature && |
| git commit -m "modification" |
| test_expect_success 'perform sparse checkout of master' ' |
| git config --local --bool core.sparsecheckout true && |
| echo "!/*" >.git/info/sparse-checkout && |
| echo "/a" >>.git/info/sparse-checkout && |
| echo "/c" >>.git/info/sparse-checkout && |
| test_path_is_missing b && |
| test_expect_success 'merge feature branch into sparse checkout of master' ' |
| test_path_is_missing b && |
| test "$(cat c)" = "modified" |
| test_expect_success 'return to full checkout of master' ' |
| echo "/*" >.git/info/sparse-checkout && |
| test "$(cat b)" = "modified" |