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

test_description='ls-tree with folders with brackets'

. ./test-lib.sh

test_expect_success 'setup' '
	mkdir -p "newdir/{{curly}}" &&
	mkdir -p "newdir/^{tree}" &&
	touch "newdir/{{curly}}/one" &&
	touch "newdir/^{tree}/two" &&
	git add "newdir/{{curly}}/one" &&
	git add "newdir/^{tree}/two" &&
	git commit -m "Test message: search me"
'

test_expect_success 'ls-tree with curly brace folder' '
	cat >expect <<-EOF &&
	100644 blob $EMPTY_BLOB	one
	EOF
	git ls-tree -r "HEAD:newdir/{{curly}}" >actual &&
	test_cmp expect actual
'

test_expect_success 'ls-tree with type restriction and curly brace folder' '
	cat >expect <<-EOF &&
	100644 blob $EMPTY_BLOB	one
	EOF
	git ls-tree "HEAD^{tree}:newdir/{{curly}}" >actual &&
	test_cmp expect actual
'

test_expect_success 'ls-tree with type restriction and folder named ^{tree}' '
	cat >expect <<-EOF &&
	100644 blob $EMPTY_BLOB	two
	EOF
	git ls-tree "HEAD^{tree}:newdir/^{tree}" >actual &&
	test_cmp expect actual
'

test_expect_success 'ls-tree with unknown type restriction' '
	(git ls-tree HEAD^{foobar} >actual || true) &&
	test_must_be_empty actual
'

test_output () {
	sed -e "s/ $OID_REGEX	/ X	/" <actual >check
	test_cmp expect check
}

test_expect_success 'ls-tree with regex' '
	cat >expect <<-EOF &&
	040000 tree X	newdir
	EOF
	git ls-tree "HEAD^{/message}" >actual &&
	test_output
'

test_expect_success 'ls-tree with regex with a colon' '
	cat >expect <<-EOF &&
	040000 tree X	newdir
	EOF
	git ls-tree "HEAD^{/message: search}" >actual &&
	test_output
'

test_expect_success 'ls-tree with regex and curly brace folder' '
	cat >expect <<-EOF &&
	100644 blob $EMPTY_BLOB	one
	EOF
	git ls-tree "HEAD^{/message: search}:newdir/{{curly}}" >actual &&
	test_cmp expect actual
'

test_done
debug log:

solving adeed5bb49 ...
found adeed5bb49 in https://public-inbox.org/git/20181229054357.11716-1-stanhu@gmail.com/

applying [1/1] https://public-inbox.org/git/20181229054357.11716-1-stanhu@gmail.com/
diff --git a/t/t3104-ls-tree-braces.sh b/t/t3104-ls-tree-braces.sh
new file mode 100755
index 0000000000..adeed5bb49

Checking patch t/t3104-ls-tree-braces.sh...
Applied patch t/t3104-ls-tree-braces.sh cleanly.

index at:
100755 adeed5bb49eff24e0360ad16841e6496290c9c12	t/t3104-ls-tree-braces.sh

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

This inbox may be cloned and mirrored by anyone:

	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

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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