Merge branch 'es/add-doc-list-short-form-of-all-in-synopsis' into maint-2.43
[git.git] / t / t3050-subprojects-fetch.sh
blob3884694165525b9e4a3d8527785f40758817be53
1 #!/bin/sh
3 test_description='fetching and pushing project with subproject'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success setup '
9 test_tick &&
10 mkdir -p sub && (
11 cd sub &&
12 git init &&
13 >subfile &&
14 git add subfile &&
15 git commit -m "subproject commit #1"
16 ) &&
17 >mainfile &&
18 git add sub mainfile &&
19 test_tick &&
20 git commit -m "superproject commit #1"
23 test_expect_success clone '
24 git clone "file://$(pwd)/.git" cloned &&
25 (git rev-parse HEAD && git ls-files -s) >expected &&
27 cd cloned &&
28 (git rev-parse HEAD && git ls-files -s) >../actual
29 ) &&
30 test_cmp expected actual
33 test_expect_success advance '
34 echo more >mainfile &&
35 git update-index --force-remove sub &&
36 mv sub/.git sub/.git-disabled &&
37 git add sub/subfile mainfile &&
38 mv sub/.git-disabled sub/.git &&
39 test_tick &&
40 git commit -m "superproject commit #2"
43 test_expect_success fetch '
44 (git rev-parse HEAD && git ls-files -s) >expected &&
46 cd cloned &&
47 git pull &&
48 (git rev-parse HEAD && git ls-files -s) >../actual
49 ) &&
50 test_cmp expected actual
53 test_done