Junio C Hamano | c43ce6d | 2006-08-03 14:41:29 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2006 Junio C Hamano |
| 4 | # |
| 5 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 6 | test_description='git read-tree --prefix test. |
Junio C Hamano | c43ce6d | 2006-08-03 14:41:29 -0700 | [diff] [blame] | 7 | ' |
| 8 | |
| 9 | . ./test-lib.sh |
| 10 | |
| 11 | test_expect_success setup ' |
| 12 | echo hello >one && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 13 | git update-index --add one && |
| 14 | tree=`git write-tree` && |
Junio C Hamano | c43ce6d | 2006-08-03 14:41:29 -0700 | [diff] [blame] | 15 | echo tree is $tree |
| 16 | ' |
| 17 | |
| 18 | echo 'one |
| 19 | two/one' >expect |
| 20 | |
| 21 | test_expect_success 'read-tree --prefix' ' |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 22 | git read-tree --prefix=two/ $tree && |
| 23 | git ls-files >actual && |
Junio C Hamano | c43ce6d | 2006-08-03 14:41:29 -0700 | [diff] [blame] | 24 | cmp expect actual |
| 25 | ' |
| 26 | |
| 27 | test_done |