blob: b6111cd150fdd69973142808cf4a86a4fa6b7e76 [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 &&
Elia Pinto7f311eb2014-04-28 05:57:34 -070014 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