#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # global test_description := ''git read-tree --prefix test. '' source ./test-lib.sh test_expect_success setup ' echo hello >one && git update-index --add one && tree=$(git write-tree) && echo tree is $tree ' echo 'one two/one' >expect test_expect_success 'read-tree --prefix' ' git read-tree --prefix=two/ $tree && git ls-files >actual && cmp expect actual ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git read-tree --prefix test.\n">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\techo hello >one &&\n"> <"\tgit update-index --add one &&\n"> <"\ttree=$(git write-tree) &&\n"> <"\techo tree is $tree\n"> ) } ) (SimpleCommand words: [{(echo)} {(SQ <"one\n"> )}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[44])] ) (C {(test_expect_success)} {(SQ <"read-tree --prefix">)} { (SQ <"\n"> <"\tgit read-tree --prefix=two/ $tree &&\n"> <"\tgit ls-files >actual &&\n"> <"\tcmp expect actual\n"> ) } ) (C {(test_done)}) ] )