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

test_description='for-each-ref errors for broken refs'

. ./test-lib.sh

ZEROS=$ZERO_OID

test_expect_success setup '
	test_oid_init &&
	MISSING=$(test_oid deadbeef) &&
	git commit --allow-empty -m "Initial" &&
	git tag testtag &&
	git for-each-ref >full-list &&
	git for-each-ref --format="%(objectname) %(refname)" >brief-list
'

test_expect_success 'Broken refs are reported correctly' '
	r=refs/heads/bogus &&
	: >.git/$r &&
	test_when_finished "rm -f .git/$r" &&
	echo "warning: ignoring broken ref $r" >broken-err &&
	git for-each-ref >out 2>err &&
	test_i18ncmp full-list out &&
	test_i18ncmp broken-err err
'

test_expect_success 'NULL_SHA1 refs are reported correctly' '
	r=refs/heads/zeros &&
	echo $ZEROS >.git/$r &&
	test_when_finished "rm -f .git/$r" &&
	echo "warning: ignoring broken ref $r" >zeros-err &&
	git for-each-ref >out 2>err &&
	test_cmp full-list out &&
	test_i18ncmp zeros-err err &&
	git for-each-ref --format="%(objectname) %(refname)" >brief-out 2>brief-err &&
	test_cmp brief-list brief-out &&
	test_i18ncmp zeros-err brief-err
'

test_expect_success 'Missing objects are reported correctly' '
	r=refs/heads/missing &&
	echo $MISSING >.git/$r &&
	test_when_finished "rm -f .git/$r" &&
	echo "fatal: missing object $MISSING for $r" >missing-err &&
	test_must_fail git for-each-ref 2>err &&
	test_i18ncmp missing-err err &&
	(
		cat brief-list &&
		echo "$MISSING $r"
	) | sort -k 2 >missing-brief-expected &&
	git for-each-ref --format="%(objectname) %(refname)" >brief-out 2>brief-err &&
	test_cmp missing-brief-expected brief-out &&
	test_must_be_empty brief-err
'

test_done
debug log:

solving d545a725a5 ...
found d545a725a5 in https://public-inbox.org/git/20200723010943.2329634-8-sandals@crustytoothpaste.net/ ||
	https://public-inbox.org/git/20200728233446.3066485-8-sandals@crustytoothpaste.net/ ||
	https://public-inbox.org/git/20200726195424.626969-8-sandals@crustytoothpaste.net/ ||
	https://public-inbox.org/git/20200710024728.3100527-8-sandals@crustytoothpaste.net/ ||
	https://public-inbox.org/git/20200713024909.3714837-8-sandals@crustytoothpaste.net/
found 49cc65bb58 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 49cc65bb58dd2b81de8f6eebd39ed1649752709d	t/t6301-for-each-ref-errors.sh

applying [1/5] https://public-inbox.org/git/20200723010943.2329634-8-sandals@crustytoothpaste.net/
diff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh
index 49cc65bb58..d545a725a5 100755

Checking patch t/t6301-for-each-ref-errors.sh...
Applied patch t/t6301-for-each-ref-errors.sh cleanly.

skipping https://public-inbox.org/git/20200728233446.3066485-8-sandals@crustytoothpaste.net/ for d545a725a5
skipping https://public-inbox.org/git/20200726195424.626969-8-sandals@crustytoothpaste.net/ for d545a725a5
skipping https://public-inbox.org/git/20200710024728.3100527-8-sandals@crustytoothpaste.net/ for d545a725a5
skipping https://public-inbox.org/git/20200713024909.3714837-8-sandals@crustytoothpaste.net/ for d545a725a5
index at:
100755 d545a725a501c25c634e7263e0fcf19b5086c8a7	t/t6301-for-each-ref-errors.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).