summaryrefslogtreecommitdiff
path: root/tests/lib-mirror
blob: 8aa751afa6ff8d78a08fbde3f71b3bccc33375e6 (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
t-mirror-setup () {
	# p must be set already

	reposmirror=$tmp/git-mirror
	pmirror=$reposmirror/$p.git
	queuedir=$tmp/git/_mirror-queue

	mkdir $reposmirror

	mirror_hook=$drs_dispatch/mirror-hook
	t-make-hook-link dgit-mirror-rsync $mirror_hook

	>$drs_dispatch/mirror-settings
	t-mirror-set remoterepos="$reposmirror"

	t-mirror-hook setup
}

t-mirror-set () {
	echo >>$drs_dispatch/mirror-settings "$1"
}

t-mirror-hook () {
	"$mirror_hook" "$drs_dispatch" "$@"
}

t-check-mirrored () {
	t-reporefs master
	t-reporefs mirror $pmirror
	diff $tmp/show-refs.{master,mirror}
	cat $queuedir/$p.log ||:
	t-files-notexist $queuedir/$p.{n,a,lock,err}
}

t-check-not-mirrored () {
	# uses previous t-reporefs-master
	t-reporefs mirror $pmirror
	diff $tmp/show-refs.{master,mirror}
}