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

test_description='test git-serve and server commands'

. ./test-lib.sh

test_expect_success 'test capability advertisement' '
	cat >expect <<-EOF &&
	version 2
	agent=git/$(git version | cut -d" " -f3)
	stateless-rpc
	0000
	EOF

	git serve --advertise-capabilities >out &&
	test-pkt-line unpack <out >actual &&
	test_cmp actual expect
'

test_expect_success 'stateless-rpc flag does not list capabilities' '
	test-pkt-line pack >in <<-EOF &&
	0000
	EOF
	git serve --stateless-rpc >out <in &&
	test_must_be_empty out
'

test_expect_success 'request invalid capability' '
	test-pkt-line pack >in <<-EOF &&
	foobar
	0000
	EOF
	test_must_fail git serve --stateless-rpc 2>err <in &&
	test_i18ngrep "unknown capability" err
'

test_expect_success 'request with no command' '
	test-pkt-line pack >in <<-EOF &&
	agent=git/test
	0000
	EOF
	test_must_fail git serve --stateless-rpc 2>err <in &&
	test_i18ngrep "no command requested" err
'

test_expect_success 'request invalid command' '
	test-pkt-line pack >in <<-EOF &&
	command=foo
	agent=git/test
	0000
	EOF
	test_must_fail git serve --stateless-rpc 2>err <in &&
	test_i18ngrep "invalid command" err
'

test_done
debug log:

solving b5cc049e5 ...
found b5cc049e5 in https://public-inbox.org/git/20180125235838.138135-13-bmwill@google.com/

applying [1/1] https://public-inbox.org/git/20180125235838.138135-13-bmwill@google.com/
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
new file mode 100755
index 000000000..b5cc049e5

Checking patch t/t5701-git-serve.sh...
Applied patch t/t5701-git-serve.sh cleanly.

index at:
100755 b5cc049e5d8f0feb497e8a899719a14474c0d6e1	t/t5701-git-serve.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).