Merge branch 'ja/doc-synopsis-markup'
[git/gitster.git] / t / t4037-diff-r-t-dirs.sh
blobb5f96fe23bd214f15ac66c1cac0291cfb1b73e58
1 #!/bin/sh
3 test_description='diff -r -t shows directory additions and deletions'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success setup '
9 mkdir dc dr dt &&
10 >dc/1 &&
11 >dr/2 &&
12 >dt/3 &&
13 >fc &&
14 >fr &&
15 >ft &&
16 git add . &&
17 test_tick &&
18 git commit -m initial &&
20 rm -fr dt dr ft fr &&
21 mkdir da ft &&
22 for p in dc/1 da/4 dt ft/5 fc
24 echo hello >$p || exit
25 done &&
26 git add -u &&
27 git add . &&
28 test_tick &&
29 git commit -m second
32 cat >expect <<\EOF
33 A da
34 A da/4
35 M dc
36 M dc/1
37 D dr
38 D dr/2
39 A dt
40 D dt
41 D dt/3
42 M fc
43 D fr
44 D ft
45 A ft
46 A ft/5
47 EOF
49 test_expect_success verify '
50 git diff-tree -r -t --name-status HEAD^ HEAD >actual &&
51 test_cmp expect actual
54 test_done