git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
0b76ab0e3f9631a5944552f9ed2a238ef9997a23 blob 5060 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
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
 
#!/bin/sh
# Copyright (c) 2011, Google Inc.

test_description='adding and checking out large blobs'

. ./test-lib.sh

test_expect_success setup '
	# clone does not allow us to pass core.bigfilethreshold to
	# new repos, so set core.bigfilethreshold globally
	git config --global core.bigfilethreshold 200k &&
	printf "%2000000s" X >large1 &&
	cp large1 large2 &&
	cp large1 large3 &&
	printf "%2500000s" Y >huge &&
	GIT_ALLOC_LIMIT=1500k &&
	export GIT_ALLOC_LIMIT
'

# add a large file with different settings
while read expect config
do
	test_expect_success "add with $config" '
		test_when_finished "rm -f .git/objects/pack/pack-*.* .git/index" &&
		git $config add large1 &&
		sz=$(test-tool path-utils file-size .git/objects/pack/pack-*.pack) &&
		case "$expect" in
		small) test "$sz" -le 100000 ;;
		large) test "$sz" -ge 100000 ;;
		esac
	'
done <<\EOF
large -c core.compression=0
small -c core.compression=9
large -c core.compression=0 -c pack.compression=0
large -c core.compression=9 -c pack.compression=0
small -c core.compression=0 -c pack.compression=9
small -c core.compression=9 -c pack.compression=9
large -c pack.compression=0
small -c pack.compression=9
EOF

test_expect_success 'add a large file or two' '
	git add large1 huge large2 &&
	# make sure we got a single packfile and no loose objects
	bad= count=0 idx= &&
	for p in .git/objects/pack/pack-*.pack
	do
		count=$(( $count + 1 ))
		if test_path_is_file "$p" &&
		   idx=${p%.pack}.idx && test_path_is_file "$idx"
		then
			continue
		fi
		bad=t
	done &&
	test -z "$bad" &&
	test $count = 1 &&
	cnt=$(git show-index <"$idx" | wc -l) &&
	test $cnt = 2 &&
	for l in .git/objects/$OIDPATH_REGEX
	do
		test_path_is_file "$l" || continue
		bad=t
	done &&
	test -z "$bad" &&

	# attempt to add another copy of the same
	git add large3 &&
	bad= count=0 &&
	for p in .git/objects/pack/pack-*.pack
	do
		count=$(( $count + 1 ))
		if test_path_is_file "$p" &&
		   idx=${p%.pack}.idx && test_path_is_file "$idx"
		then
			continue
		fi
		bad=t
	done &&
	test -z "$bad" &&
	test $count = 1
'

test_expect_success 'checkout a large file' '
	large1=$(git rev-parse :large1) &&
	git update-index --add --cacheinfo 100644 $large1 another &&
	git checkout another &&
	test_cmp large1 another
'

test_expect_success 'packsize limit' '
	test_create_repo mid &&
	(
		cd mid &&
		git config core.bigfilethreshold 64k &&
		git config pack.packsizelimit 256k &&

		# mid1 and mid2 will fit within 256k limit but
		# appending mid3 will bust the limit and will
		# result in a separate packfile.
		test-tool genrandom "a" $(( 66 * 1024 )) >mid1 &&
		test-tool genrandom "b" $(( 80 * 1024 )) >mid2 &&
		test-tool genrandom "c" $(( 128 * 1024 )) >mid3 &&
		git add mid1 mid2 mid3 &&

		count=0 &&
		for pi in .git/objects/pack/pack-*.idx
		do
			test_path_is_file "$pi" && count=$(( $count + 1 ))
		done &&
		test $count = 2 &&

		(
			git hash-object --stdin <mid1 &&
			git hash-object --stdin <mid2 &&
			git hash-object --stdin <mid3
		) |
		sort >expect &&

		for pi in .git/objects/pack/pack-*.idx
		do
			git show-index <"$pi"
		done |
		sed -e "s/^[0-9]* \([0-9a-f]*\) .*/\1/" |
		sort >actual &&

		test_cmp expect actual
	)
'

test_expect_success 'diff --raw' '
	git commit -q -m initial &&
	echo modified >>large1 &&
	git add large1 &&
	git commit -q -m modified &&
	git diff --raw HEAD^
'

test_expect_success 'diff --stat' '
	git diff --stat HEAD^ HEAD
'

test_expect_success 'diff' '
	git diff HEAD^ HEAD >actual &&
	grep "Binary files.*differ" actual
'

test_expect_success 'diff --cached' '
	git diff --cached HEAD^ >actual &&
	grep "Binary files.*differ" actual
'

test_expect_success 'hash-object' '
	git hash-object large1
'

test_expect_success 'cat-file a large file' '
	git cat-file blob :large1 >/dev/null
'

test_expect_success 'cat-file a large file from a tag' '
	git tag -m largefile largefiletag :large1 &&
	git cat-file blob largefiletag >/dev/null
'

test_expect_success 'git-show a large file' '
	git show :large1 >/dev/null

'

test_expect_success 'index-pack' '
	git clone file://"$(pwd)"/.git foo &&
	GIT_DIR=non-existent git index-pack --object-format=$(test_oid algo) \
		--strict --verify foo/.git/objects/pack/*.pack
'

test_expect_success 'repack' '
	git repack -ad
'

test_expect_success 'pack-objects with large loose object' '
	SHA1=$(git hash-object huge) &&
	test_create_repo loose &&
	echo $SHA1 | git pack-objects --stdout |
		GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects &&
	echo $SHA1 | GIT_DIR=loose/.git git pack-objects pack &&
	test_create_repo packed &&
	mv pack-* packed/.git/objects/pack &&
	GIT_DIR=packed/.git git cat-file blob $SHA1 >actual &&
	test_cmp huge actual
'

test_expect_success 'tar archiving' '
	git archive --format=tar HEAD >/dev/null
'

test_expect_success 'zip archiving, store only' '
	git archive --format=zip -0 HEAD >/dev/null
'

test_expect_success 'zip archiving, deflate' '
	git archive --format=zip HEAD >/dev/null
'

test_expect_success 'fsck large blobs' '
	git fsck 2>err &&
	test_must_be_empty err
'

test_done
debug log:

solving 0b76ab0e3f9 ...
found 0b76ab0e3f9 in https://public-inbox.org/git/patch-5.5-947791d9535-20210421T144921Z-avarab@gmail.com/ ||
	https://public-inbox.org/git/patch-4.4-ac0b920c041-20210423T072824Z-avarab@gmail.com/
found 4bab6a513c5 in git.git.git
preparing index
index prepared:
100755 4bab6a513c5c951c084d59a0e6ccd42422f27978	t/t1050-large.sh

applying [1/2] https://public-inbox.org/git/patch-5.5-947791d9535-20210421T144921Z-avarab@gmail.com/
diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index 4bab6a513c5..0b76ab0e3f9 100755

Checking patch t/t1050-large.sh...
Applied patch t/t1050-large.sh cleanly.

skipping https://public-inbox.org/git/patch-4.4-ac0b920c041-20210423T072824Z-avarab@gmail.com/ for 0b76ab0e3f9
index at:
100755 0b76ab0e3f9631a5944552f9ed2a238ef9997a23	t/t1050-large.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