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