| test_description='test finding specific blobs in the revision walking' |
| test_expect_success 'setup ' ' |
| git commit --allow-empty -m "empty initial commit" && |
| echo "Hello, world!" >greeting && |
| git commit -m "add the greeting blob" && # borrowed from Git from the Bottom Up |
| git tag -m "the blob" greeting $(git rev-parse HEAD:greeting) && |
| git commit -m "unrelated history" && |
| git commit --allow-empty -m "another unrelated commit" |
| test_expect_success 'find the greeting blob' ' |
| Revert "add the greeting blob" |
| git log --format=%s --find-object=greeting^{blob} >actual && |
| test_expect_success 'setup a tree' ' |
| git commit -m "add a file in a subdirectory" |
| test_expect_success 'find a tree' ' |
| add a file in a subdirectory |
| git log --format=%s -t --find-object=HEAD:a >actual && |
| test_expect_success 'setup a submodule' ' |
| test_commit -C sub sub && |
| git submodule add ./sub sub && |
| git commit -a -m "add sub" |
| test_expect_success 'find a submodule' ' |
| git log --format=%s --find-object=HEAD:sub >actual && |