Alexandre Julliard | db137fe | 2009-08-17 17:35:44 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='test read-tree into a fresh index file' |
| 4 | |
Johannes Schindelin | 06d5314 | 2020-11-18 23:44:21 +0000 | [diff] [blame] | 5 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
Johannes Schindelin | 334afbc | 2020-11-18 23:44:19 +0000 | [diff] [blame] | 6 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
| 7 | |
Ævar Arnfjörð Bjarmason | 98300c8 | 2021-10-12 15:56:43 +0200 | [diff] [blame] | 8 | TEST_PASSES_SANITIZE_LEAK=true |
Alexandre Julliard | db137fe | 2009-08-17 17:35:44 +0200 | [diff] [blame] | 9 | . ./test-lib.sh |
| 10 | |
| 11 | test_expect_success setup ' |
| 12 | echo one >a && |
| 13 | git add a && |
| 14 | git commit -m initial |
| 15 | ' |
| 16 | |
| 17 | test_expect_success 'non-existent index file' ' |
| 18 | rm -f new-index && |
Johannes Schindelin | 06d5314 | 2020-11-18 23:44:21 +0000 | [diff] [blame] | 19 | GIT_INDEX_FILE=new-index git read-tree main |
Alexandre Julliard | db137fe | 2009-08-17 17:35:44 +0200 | [diff] [blame] | 20 | ' |
| 21 | |
| 22 | test_expect_success 'empty index file' ' |
| 23 | rm -f new-index && |
| 24 | > new-index && |
Johannes Schindelin | 06d5314 | 2020-11-18 23:44:21 +0000 | [diff] [blame] | 25 | GIT_INDEX_FILE=new-index git read-tree main |
Alexandre Julliard | db137fe | 2009-08-17 17:35:44 +0200 | [diff] [blame] | 26 | ' |
| 27 | |
| 28 | test_done |
| 29 | |