| # Copyright (c) 2006 Junio C Hamano |
| test_description='git-checkout tests.' |
| test_expect_success setup ' |
| git commit -m "Initial A one, A two" && |
| git update-index --add --remove one two three && |
| git commit -m "Side M one, D two, A three" && |
| test_expect_success "checkout with dirty tree without -m" ' |
| echo "happy - failed correctly" |
| test_expect_success "checkout -m with dirty tree" ' |
| git checkout -f master && |
| fill " master" "* side" >expect.branch && |
| git branch >current.branch && |
| diff expect.branch current.branch && |
| fill "M one" "A three" "D two" >expect.master && |
| git diff --name-status master >current.master && |
| diff expect.master current.master && |
| fill "M one" >expect.side && |
| git diff --name-status side >current.side && |
| diff expect.side current.side && |
| git diff --cached >current.index && |
| diff expect.index current.index |