| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='test read-tree into a fresh index file' |
| 4 | |
| 5 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
| 6 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
| 7 | |
| 8 | . ./test-lib.sh |
| 9 | |
| 10 | test_expect_success setup ' |
| 11 | echo one >a && |
| 12 | git add a && |
| 13 | git commit -m initial |
| 14 | ' |
| 15 | |
| 16 | test_expect_success 'non-existent index file' ' |
| 17 | rm -f new-index && |
| 18 | GIT_INDEX_FILE=new-index git read-tree main |
| 19 | ' |
| 20 | |
| 21 | test_expect_success 'empty index file' ' |
| 22 | rm -f new-index && |
| 23 | > new-index && |
| 24 | GIT_INDEX_FILE=new-index git read-tree main |
| 25 | ' |
| 26 | |
| 27 | test_done |
| 28 |