]>
Commit | Line | Data |
---|---|---|
1211be6b LT |
1 | #!/bin/sh |
2 | ||
3 | test_description='fetching and pushing project with subproject' | |
4 | ||
dd4143e7 | 5 | TEST_PASSES_SANITIZE_LEAK=true |
1211be6b LT |
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 && | |
a48fcd83 | 14 | git add subfile && |
1211be6b LT |
15 | git commit -m "subproject commit #1" |
16 | ) && | |
a48fcd83 | 17 | >mainfile && |
1211be6b LT |
18 | git add sub mainfile && |
19 | test_tick && | |
20 | git commit -m "superproject commit #1" | |
21 | ' | |
22 | ||
23 | test_expect_success clone ' | |
f69e836f | 24 | git clone "file://$(pwd)/.git" cloned && |
3ea67379 | 25 | (git rev-parse HEAD && git ls-files -s) >expected && |
1211be6b LT |
26 | ( |
27 | cd cloned && | |
3ea67379 | 28 | (git rev-parse HEAD && git ls-files -s) >../actual |
1211be6b | 29 | ) && |
82ebb0b6 | 30 | test_cmp expected actual |
1211be6b LT |
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 ' | |
3ea67379 | 44 | (git rev-parse HEAD && git ls-files -s) >expected && |
1211be6b LT |
45 | ( |
46 | cd cloned && | |
47 | git pull && | |
3ea67379 | 48 | (git rev-parse HEAD && git ls-files -s) >../actual |
1211be6b | 49 | ) && |
82ebb0b6 | 50 | test_cmp expected actual |
1211be6b LT |
51 | ' |
52 | ||
53 | test_done |