| test_description='git rev-list trivial path optimization test' |
| test_expect_success setup ' |
| git commit -m "Initial commit" a && |
| initial=$(git rev-parse --verify HEAD) |
| test_expect_success path-optimization ' |
| commit=$(echo "Unchanged tree" | git commit-tree "HEAD^{tree}" -p HEAD) && |
| test $(git rev-list $commit | wc -l) = 2 && |
| test $(git rev-list $commit -- . | wc -l) = 1 |
| test_expect_success 'further setup' ' |
| git commit -m "Side makes an irrelevant commit" && |
| echo "More Irrelevancy" >c && |
| git commit -m "Side makes another irrelevant commit" && |
| git commit -m "Side touches a" && |
| side=$(git rev-parse --verify HEAD) && |
| echo "Yet more Irrelevancy" >c && |
| git commit -m "Side makes yet another irrelevant commit" && |
| git commit -m "Master touches b" && |
| git commit -m "Master touches b again" |
| test_expect_success 'path optimization 2' ' |
| ( echo "$side"; echo "$initial" ) >expected && |
| git rev-list HEAD -- a >actual && |