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

test_description='test fetching bundles with --bundle-uri'

. ./test-lib.sh

test_expect_success 'fail to fetch from non-existent file' '
	test_must_fail git fetch --bundle-uri="$(pwd)/does-not-exist" 2>err &&
	grep "failed to download bundle from URI" err
'

test_expect_success 'fail to fetch from non-bundle file' '
	echo bogus >bogus &&
	test_must_fail git fetch --bundle-uri="$(pwd)/bogus" 2>err &&
	grep "is not a bundle" err
'

test_expect_success 'create bundle' '
	git init fetch-from &&
	git -C fetch-from checkout -b topic &&
	test_commit -C fetch-from A &&
	test_commit -C fetch-from B &&
	git -C fetch-from bundle create B.bundle topic
'

test_expect_success 'fetch file bundle' '
	git init fetch-to &&
	git -C fetch-to fetch --bundle-uri="$(pwd)/fetch-from/B.bundle" &&
	git -C fetch-to rev-parse refs/bundles/topic >actual &&
	git -C fetch-from rev-parse topic >expect &&
	test_cmp expect actual
'

test_expect_success 'fetch file:// bundle' '
	git init fetch-file &&
	git -C fetch-file fetch --bundle-uri="file://$(pwd)/fetch-from/B.bundle" &&
	git -C fetch-file rev-parse refs/bundles/topic >actual &&
	git -C fetch-from rev-parse topic >expect &&
	test_cmp expect actual
'

#########################################################################
# HTTP tests begin here

. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd

test_expect_success 'fail to fetch from non-existent HTTP URL' '
	test_must_fail git fetch --bundle-uri="$HTTPD_URL/does-not-exist" 2>err &&
	grep "failed to download bundle from URI" err
'

test_expect_success 'fail to fetch from non-bundle HTTP URL' '
	echo bogus >"$HTTPD_DOCUMENT_ROOT_PATH/bogus" &&
	test_must_fail git fetch --bundle-uri="$HTTPD_URL/bogus" 2>err &&
	grep "is not a bundle" err
'

test_expect_success 'fetch HTTP bundle' '
	cp fetch-from/B.bundle "$HTTPD_DOCUMENT_ROOT_PATH/B.bundle" &&
	git init fetch-http &&
	git -C fetch-http fetch --bundle-uri="$HTTPD_URL/B.bundle" &&
	git -C fetch-http rev-parse refs/bundles/topic >actual &&
	git -C fetch-from rev-parse topic >expect &&
	test_cmp expect actual
'

# Do not add tests here unless they use the HTTP server, as they will
# not run unless the HTTP dependencies exist.

test_done
debug log:

solving 919db6f4551 ...
found 919db6f4551 in https://80x24.org/mirrors/git.git

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).