2006-08-04 05:41:29 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
2007-07-03 13:52:14 +08:00
|
|
|
test_description='git read-tree --prefix test.
|
2006-08-04 05:41:29 +08:00
|
|
|
'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success setup '
|
|
|
|
echo hello >one &&
|
2007-07-03 13:52:14 +08:00
|
|
|
git update-index --add one &&
|
2014-04-28 20:57:34 +08:00
|
|
|
tree=$(git write-tree) &&
|
2006-08-04 05:41:29 +08:00
|
|
|
echo tree is $tree
|
|
|
|
'
|
|
|
|
|
|
|
|
echo 'one
|
|
|
|
two/one' >expect
|
|
|
|
|
|
|
|
test_expect_success 'read-tree --prefix' '
|
2007-07-03 13:52:14 +08:00
|
|
|
git read-tree --prefix=two/ $tree &&
|
|
|
|
git ls-files >actual &&
|
2006-08-04 05:41:29 +08:00
|
|
|
cmp expect actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|