git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
0054163ce4de4149b4973d5989723c62a7b5e46a blob 1306 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
 
#!/bin/sh

test_description='fetch/push involving alternates'
. ./test-lib.sh

count_objects () {
	loose=0 inpack=0
	eval "$(
		git count-objects -v |
		sed -n -e 's/^count: \(.*\)/loose=\1/p' \
		    -e 's/^in-pack: \(.*\)/inpack=\1/p'
	)" &&
	echo $(( $loose + $inpack ))
}


test_expect_success setup '
	(
		git init original &&
		cd original &&
		i=0 &&
		while test $i -le 100
		do
			echo "$i" >count &&
			git add count &&
			git commit -m "$i" || exit
			i=$(($i + 1))
		done
	) &&
	(
		git clone --reference=original "file://$(pwd)/original" one &&
		cd one &&
		echo Z >count &&
		git add count &&
		git commit -m Z &&
		count_objects >../one.count
	) &&
	A=$(pwd)/original/.git/objects &&
	git init receiver &&
	echo "$A" >receiver/.git/objects/info/alternates &&
	git init fetcher &&
	echo "$A" >fetcher/.git/objects/info/alternates
'

test_expect_success 'pushing into a repository with the same alternate' '
	(
		cd one &&
		git push ../receiver main:refs/heads/it
	) &&
	(
		cd receiver &&
		count_objects >../receiver.count
	) &&
	test_cmp one.count receiver.count
'

test_expect_success 'fetching from a repository with the same alternate' '
	(
		cd fetcher &&
		git fetch ../one main:refs/heads/it &&
		count_objects >../fetcher.count
	) &&
	test_cmp one.count fetcher.count
'

test_done
debug log:

solving 0054163ce4 ...
found 0054163ce4 in https://public-inbox.org/git/b5ca6e9acd0c7c501584d042a9676f0f54d17a29.1605221039.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/332677cbf9dd889242b4e4105272988cd40a7758.1605629548.git.gitgitgadget@gmail.com/
found 1bc57ac03f in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 1bc57ac03f9df7e82fab5478b7234ab1435c60e3	t/t5501-fetch-push-alternates.sh

applying [1/2] https://public-inbox.org/git/b5ca6e9acd0c7c501584d042a9676f0f54d17a29.1605221039.git.gitgitgadget@gmail.com/
diff --git a/t/t5501-fetch-push-alternates.sh b/t/t5501-fetch-push-alternates.sh
index 1bc57ac03f..0054163ce4 100755

Checking patch t/t5501-fetch-push-alternates.sh...
Applied patch t/t5501-fetch-push-alternates.sh cleanly.

skipping https://public-inbox.org/git/332677cbf9dd889242b4e4105272988cd40a7758.1605629548.git.gitgitgadget@gmail.com/ for 0054163ce4
index at:
100755 0054163ce4de4149b4973d5989723c62a7b5e46a	t/t5501-fetch-push-alternates.sh

Code repositories for project(s) associated with this inbox:

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).