1#!/bin/sh
2
3test_description='test read-tree into a fresh index file'
4
5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8TEST_PASSES_SANITIZE_LEAK=true
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 &&
19	GIT_INDEX_FILE=new-index git read-tree main
20'
21
22test_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
28test_done
29
30