]> git.ipfire.org Git - thirdparty/git.git/blame - t/t1009-read-tree-new-index.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t1009-read-tree-new-index.sh
CommitLineData
db137fe9
AJ
1#!/bin/sh
2
3test_description='test read-tree into a fresh index file'
4
06d53148 5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
98300c81 8TEST_PASSES_SANITIZE_LEAK=true
db137fe9
AJ
9. ./test-lib.sh
10
11test_expect_success setup '
12 echo one >a &&
13 git add a &&
14 git commit -m initial
15'
16
17test_expect_success 'non-existent index file' '
18 rm -f new-index &&
06d53148 19 GIT_INDEX_FILE=new-index git read-tree main
db137fe9
AJ
20'
21
22test_expect_success 'empty index file' '
23 rm -f new-index &&
24 > new-index &&
06d53148 25 GIT_INDEX_FILE=new-index git read-tree main
db137fe9
AJ
26'
27
28test_done
29