Merge branch 'maint'
[git/repo.git] / t / t4027-diff-submodule.sh
blob3d2d0816a3656a0df347fbd29571f5c38513c27f
1 #!/bin/sh
3 test_description='difference in submodules'
5 . ./test-lib.sh
6 . ../diff-lib.sh
8 _z40=0000000000000000000000000000000000000000
9 test_expect_success setup '
10 test_tick &&
11 test_create_repo sub &&
13 cd sub &&
14 echo hello >world &&
15 git add world &&
16 git commit -m submodule
17 ) &&
19 test_tick &&
20 echo frotz >nitfol &&
21 git add nitfol sub &&
22 git commit -m superproject &&
25 cd sub &&
26 echo goodbye >world &&
27 git add world &&
28 git commit -m "submodule #2"
29 ) &&
31 set x $(
32 cd sub &&
33 git rev-list HEAD
34 ) &&
35 echo ":160000 160000 $3 $_z40 M sub" >expect
38 test_expect_success 'git diff --raw HEAD' '
39 git diff --raw --abbrev=40 HEAD >actual &&
40 diff -u expect actual
43 test_expect_success 'git diff-index --raw HEAD' '
44 git diff-index --raw HEAD >actual.index &&
45 diff -u expect actual.index
48 test_expect_success 'git diff-files --raw' '
49 git diff-files --raw >actual.files &&
50 diff -u expect actual.files
53 test_done