Welcome to mirror list, hosted at ThFree Co, Russian Federation.

t3050-subprojects-fetch.sh « t - git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3884694165525b9e4a3d8527785f40758817be53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

test_description='fetching and pushing project with subproject'

TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh

test_expect_success setup '
	test_tick &&
	mkdir -p sub && (
		cd sub &&
		git init &&
		>subfile &&
		git add subfile &&
		git commit -m "subproject commit #1"
	) &&
	>mainfile &&
	git add sub mainfile &&
	test_tick &&
	git commit -m "superproject commit #1"
'

test_expect_success clone '
	git clone "file://$(pwd)/.git" cloned &&
	(git rev-parse HEAD && git ls-files -s) >expected &&
	(
		cd cloned &&
		(git rev-parse HEAD && git ls-files -s) >../actual
	) &&
	test_cmp expected actual
'

test_expect_success advance '
	echo more >mainfile &&
	git update-index --force-remove sub &&
	mv sub/.git sub/.git-disabled &&
	git add sub/subfile mainfile &&
	mv sub/.git-disabled sub/.git &&
	test_tick &&
	git commit -m "superproject commit #2"
'

test_expect_success fetch '
	(git rev-parse HEAD && git ls-files -s) >expected &&
	(
		cd cloned &&
		git pull &&
		(git rev-parse HEAD && git ls-files -s) >../actual
	) &&
	test_cmp expected actual
'

test_done