mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
06d531486e
Carefully excluding t1309, which sees independent development elsewhere at the time of writing, we transition above-mentioned tests to the default branch name `main`. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh && git checkout HEAD -- t1309\*) Note that t5533 contains a variation of the name `master` (`naster`) that we rename here, too. This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
28 lines
510 B
Bash
Executable file
28 lines
510 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='test read-tree into a fresh index file'
|
|
|
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success setup '
|
|
echo one >a &&
|
|
git add a &&
|
|
git commit -m initial
|
|
'
|
|
|
|
test_expect_success 'non-existent index file' '
|
|
rm -f new-index &&
|
|
GIT_INDEX_FILE=new-index git read-tree main
|
|
'
|
|
|
|
test_expect_success 'empty index file' '
|
|
rm -f new-index &&
|
|
> new-index &&
|
|
GIT_INDEX_FILE=new-index git read-tree main
|
|
'
|
|
|
|
test_done
|
|
|