]> git.ipfire.org Git - thirdparty/git.git/blob - t/t1009-read-tree-new-index.sh
Merge branch 'jc/c99-var-decl-in-for-loop'
[thirdparty/git.git] / t / t1009-read-tree-new-index.sh
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_PASSES_SANITIZE_LEAK=true
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 &&
19 GIT_INDEX_FILE=new-index git read-tree main
20 '
21
22 test_expect_success 'empty index file' '
23 rm -f new-index &&
24 > new-index &&
25 GIT_INDEX_FILE=new-index git read-tree main
26 '
27
28 test_done
29