git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
f3ea8dcf58f88591183c31baec4997d53641bbf2 blob 2445 bytes (raw)

 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 
#!/bin/sh

test_description='Basic subproject functionality'
. ./test-lib.sh

test_expect_success 'setup: create superproject' '
	: >Makefile &&
	git add Makefile &&
	git commit -m "Superproject created"
'

test_expect_success 'setup: create subprojects' '
	mkdir sub1 &&
	( cd sub1 && git init && : >Makefile && git add * &&
	git commit -q -m "subproject 1" ) &&
	mkdir sub2 &&
	( cd sub2 && git init && : >Makefile && git add * &&
	git commit -q -m "subproject 2" ) &&
	git update-index --add sub1 &&
	git add sub2 &&
	git commit -q -m "subprojects added" &&
	GIT_PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev=5 HEAD^ HEAD |cut -d" " -f-3,5- >current &&
	git branch save HEAD &&
	cat >expected <<-\EOF &&
	:000000 160000 00000... A	sub1
	:000000 160000 00000... A	sub2
	EOF
	test_cmp expected current
'

test_expect_success 'check if fsck ignores the subprojects' '
	git fsck --full
'

test_expect_success 'check if commit in a subproject detected' '
	( cd sub1 &&
	echo "all:" >>Makefile &&
	echo "	true" >>Makefile &&
	git commit -q -a -m "make all" ) &&
	test_expect_code 1 git diff-files --exit-code
'

test_expect_success 'check if a changed subproject HEAD can be committed' '
	git commit -q -a -m "sub1 changed" &&
	test_expect_code 1 git diff-tree --exit-code HEAD^ HEAD
'

test_expect_success 'check if diff-index works for subproject elements' '
	test_expect_code 1 git diff-index --exit-code --cached save -- sub1
'

test_expect_success 'check if diff-tree works for subproject elements' '
	test_expect_code 1 git diff-tree --exit-code HEAD^ HEAD -- sub1
'

test_expect_success 'check if git diff works for subproject elements' '
	test_expect_code 1 git diff --exit-code HEAD^ HEAD
'

test_expect_success 'check if clone works' '
	git ls-files -s >expected &&
	git clone -l -s . cloned &&
	( cd cloned && git ls-files -s ) >current &&
	test_cmp expected current
'

test_expect_success 'removing and adding subproject' '
	git update-index --force-remove -- sub2 &&
	mv sub2 sub3 &&
	git add sub3 &&
	git commit -q -m "renaming a subproject" &&
	test_expect_code 1 git diff -M --name-status --exit-code HEAD^ HEAD
'

# the index must contain the object name the HEAD of the
# subproject sub1 was at the point "save"
test_expect_success 'checkout in superproject' '
	git checkout save &&
	git diff-index --exit-code --raw --cached save -- sub1
'

# just interesting what happened...
# git diff --name-status -M save main

test_done
debug log:

solving f3ea8dcf58 ...
found f3ea8dcf58 in https://public-inbox.org/git/0697ef9742af1ab15bd886990bbc0080bad6f41c.1605221039.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/aee29a0528462137af6811d22da50dfcad585b84.1605629548.git.gitgitgadget@gmail.com/
found b81eb5fd6f in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 b81eb5fd6ffaf02d2a404bcbbf71e674494fd6cb	t/t3040-subprojects-basic.sh

applying [1/2] https://public-inbox.org/git/0697ef9742af1ab15bd886990bbc0080bad6f41c.1605221039.git.gitgitgadget@gmail.com/
diff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh
index b81eb5fd6f..f3ea8dcf58 100755

Checking patch t/t3040-subprojects-basic.sh...
Applied patch t/t3040-subprojects-basic.sh cleanly.

skipping https://public-inbox.org/git/aee29a0528462137af6811d22da50dfcad585b84.1605629548.git.gitgitgadget@gmail.com/ for f3ea8dcf58
index at:
100755 f3ea8dcf58f88591183c31baec4997d53641bbf2	t/t3040-subprojects-basic.sh

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git