]> git.ipfire.org Git - thirdparty/git.git/blob - t/t3050-subprojects-fetch.sh
The third batch
[thirdparty/git.git] / t / t3050-subprojects-fetch.sh
1 #!/bin/sh
2
3 test_description='fetching and pushing project with subproject'
4
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
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"
21 '
22
23 test_expect_success clone '
24 git clone "file://$(pwd)/.git" cloned &&
25 (git rev-parse HEAD && git ls-files -s) >expected &&
26 (
27 cd cloned &&
28 (git rev-parse HEAD && git ls-files -s) >../actual
29 ) &&
30 test_cmp expected actual
31 '
32
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"
41 '
42
43 test_expect_success fetch '
44 (git rev-parse HEAD && git ls-files -s) >expected &&
45 (
46 cd cloned &&
47 git pull &&
48 (git rev-parse HEAD && git ls-files -s) >../actual
49 ) &&
50 test_cmp expected actual
51 '
52
53 test_done