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

test_description='test env--helper'

. ./test-lib.sh


test_expect_success 'env--helper usage' '
	test_must_fail git env--helper &&
	test_must_fail git env--helper --mode-bool &&
	test_must_fail git env--helper --mode-ulong &&
	test_must_fail git env--helper --mode-bool --variable &&
	test_must_fail git env--helper --mode-bool --variable --default &&
	test_must_fail git env--helper --mode-bool --variable= --default=
'

test_expect_success 'env--helper bad default values' '
	test_must_fail git env--helper --mode-bool --variable=MISSING --default=1xyz &&
	test_must_fail git env--helper --mode-ulong --variable=MISSING --default=1xyz
'

test_expect_success 'env--helper --mode-bool' '
	echo 1 >expected &&
	git env--helper --mode-bool --variable=MISSING --default=1 --exit-code >actual &&
	test_cmp expected actual &&

	echo 0 >expected &&
	test_must_fail git env--helper --mode-bool --variable=MISSING --default=0 --exit-code >actual &&
	test_cmp expected actual &&

	git env--helper --mode-bool --variable=MISSING --default=0 >actual &&
	test_cmp expected actual &&

	>expected &&
	git env--helper --mode-bool --variable=MISSING --default=1 --exit-code --quiet >actual &&
	test_cmp expected actual &&

	EXISTS=true git env--helper --mode-bool --variable=EXISTS --default=0 --exit-code --quiet >actual &&
	test_cmp expected actual &&

	echo 1 >expected &&
	EXISTS=true git env--helper --mode-bool --variable=EXISTS --default=0 --exit-code >actual &&
	test_cmp expected actual
'

test_expect_success 'env--helper --mode-ulong' '
	echo 1234567890 >expected &&
	git env--helper --mode-ulong --variable=MISSING --default=1234567890 --exit-code >actual &&
	test_cmp expected actual &&

	echo 0 >expected &&
	test_must_fail git env--helper --mode-ulong --variable=MISSING --default=0 --exit-code >actual &&
	test_cmp expected actual &&

	git env--helper --mode-ulong --variable=MISSING --default=0 >actual &&
	test_cmp expected actual &&

	>expected &&
	git env--helper --mode-ulong --variable=MISSING --default=1234567890 --exit-code --quiet >actual &&
	test_cmp expected actual &&

	EXISTS=1234567890 git env--helper --mode-ulong --variable=EXISTS --default=0 --exit-code --quiet >actual &&
	test_cmp expected actual &&

	echo 1234567890 >expected &&
	EXISTS=1234567890 git env--helper --mode-ulong --variable=EXISTS --default=0 --exit-code >actual &&
	test_cmp expected actual
'

test_expect_success 'env--helper reads config thanks to trace2' '
	mkdir home &&
	git config -f home/.gitconfig include.path cycle &&
	git config -f home/cycle include.path .gitconfig &&

	test_must_fail \
		env HOME="$(pwd)/home" GIT_TEST_GETTEXT_POISON=false \
		git config -l 2>err &&
	grep "exceeded maximum include depth" err &&

	test_must_fail \
		env HOME="$(pwd)/home" GIT_TEST_GETTEXT_POISON=true \
		git -C cycle env--helper --mode-bool --variable=GIT_TEST_GETTEXT_POISON --default=0 --exit-code --quiet 2>err &&
	grep "# GETTEXT POISON #" err
'

test_done
debug log:

solving f62814241d ...
found f62814241d in https://public-inbox.org/git/20190620210915.11297-6-avarab@gmail.com/
found 4dc4ab35e5 in https://public-inbox.org/git/20190620210915.11297-3-avarab@gmail.com/

applying [1/2] https://public-inbox.org/git/20190620210915.11297-3-avarab@gmail.com/
diff --git a/t/t0017-env-helper.sh b/t/t0017-env-helper.sh
new file mode 100755
index 0000000000..4dc4ab35e5


applying [2/2] https://public-inbox.org/git/20190620210915.11297-6-avarab@gmail.com/
diff --git a/t/t0017-env-helper.sh b/t/t0017-env-helper.sh
index 4dc4ab35e5..f62814241d 100755

Checking patch t/t0017-env-helper.sh...
Applied patch t/t0017-env-helper.sh cleanly.
Checking patch t/t0017-env-helper.sh...
Applied patch t/t0017-env-helper.sh cleanly.

index at:
100755 f62814241d1f6585498f29b15e45edb438e9aaee	t/t0017-env-helper.sh

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

Archives are clonable:
	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

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/

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