| test_description='miscellaneous rev-list tests' |
| test_expect_success setup ' |
| echo content1 >wanted_file && |
| echo content2 >unwanted_file && |
| git add wanted_file unwanted_file && |
| test_expect_success 'rev-list --objects heeds pathspecs' ' |
| git rev-list --objects HEAD -- wanted_file >output && |
| grep wanted_file output && |
| ! grep unwanted_file output |
| test_expect_success 'rev-list --objects with pathspecs and deeper paths' ' |
| git rev-list --objects HEAD -- foo >output && |
| git rev-list --objects HEAD -- foo/file >output && |
| ! grep unwanted_file output |
| test_expect_success 'rev-list --objects with pathspecs and copied files' ' |
| git checkout --orphan junio-testcase && |
| ONE=$(git rev-parse HEAD:one) |
| git rev-list --objects HEAD two >output && |
| grep "$ONE two/three" output && |