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