summaryrefslogtreecommitdiff
path: root/t/t3050-subprojects-fetch.sh
blob: 34f26a8d9ed809f07d1ae5eec847c2f0ac1d2b5e (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
#!/bin/sh

test_description='fetching and pushing project with subproject'

. ./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
	) &&
	diff -u 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
	) &&
	diff -u expected actual
'

test_done