Merge branch 'fc/advice-diverged-history'
[git/debian.git] / t / t1008-read-tree-overlay.sh
blobad5936e54d1f73ed46c1066600f273f0847ca673
1 #!/bin/sh
3 test_description='test multi-tree read-tree without merging'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
10 . "$TEST_DIRECTORY"/lib-read-tree.sh
12 test_expect_success setup '
13 echo one >a &&
14 git add a &&
15 git commit -m initial &&
16 git tag initial &&
17 echo two >b &&
18 git add b &&
19 git commit -m second &&
20 git checkout -b side initial &&
21 echo three >a &&
22 mkdir b &&
23 echo four >b/c &&
24 git add b/c &&
25 git commit -m third
28 test_expect_success 'multi-read' '
29 read_tree_must_succeed initial main side &&
30 test_write_lines a b/c >expect &&
31 git ls-files >actual &&
32 test_cmp expect actual
35 test_done