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