blob: 8c6d67edda1468ba0f1c7afc6d13ea3a7bbe0a90 [file] [log] [blame]
Junio C Hamanoc43ce6d2006-08-03 14:41:29 -07001#!/bin/sh
2#
3# Copyright (c) 2006 Junio C Hamano
4#
5
Junio C Hamano5be60072007-07-02 22:52:14 -07006test_description='git read-tree --prefix test.
Junio C Hamanoc43ce6d2006-08-03 14:41:29 -07007'
8
9. ./test-lib.sh
10
11test_expect_success setup '
12 echo hello >one &&
Junio C Hamano5be60072007-07-02 22:52:14 -070013 git update-index --add one &&
14 tree=`git write-tree` &&
Junio C Hamanoc43ce6d2006-08-03 14:41:29 -070015 echo tree is $tree
16'
17
18echo 'one
19two/one' >expect
20
21test_expect_success 'read-tree --prefix' '
Junio C Hamano5be60072007-07-02 22:52:14 -070022 git read-tree --prefix=two/ $tree &&
23 git ls-files >actual &&
Junio C Hamanoc43ce6d2006-08-03 14:41:29 -070024 cmp expect actual
25'
26
27test_done