#!/bin/sh global test_description := ''test read-tree into a fresh index file'' source ./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 master ' test_expect_success 'empty index file' ' rm -f new-index && > new-index && GIT_INDEX_FILE=new-index git read-tree master ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"test read-tree into a fresh index file">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} {(SQ <"\n"> <"\techo one >a &&\n"> <"\tgit add a &&\n"> <"\tgit commit -m initial\n">)} ) (C {(test_expect_success)} {(SQ <"non-existent index file">)} {(SQ <"\n"> <"\trm -f new-index &&\n"> <"\tGIT_INDEX_FILE=new-index git read-tree master\n">)} ) (C {(test_expect_success)} {(SQ <"empty index file">)} { (SQ <"\n"> <"\trm -f new-index &&\n"> <"\t> new-index &&\n"> <"\tGIT_INDEX_FILE=new-index git read-tree master\n"> ) } ) (C {(test_done)}) ] )