Commit 3661e35e4ecb503da656a86e52b9017868dd4208

Edward Thomson 2019-06-23T23:52:24

filter: test we can filter a blob in a bare repo

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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
diff --git a/tests/filter/bare.c b/tests/filter/bare.c
new file mode 100644
index 0000000..495e04e
--- /dev/null
+++ b/tests/filter/bare.c
@@ -0,0 +1,111 @@
+#include "clar_libgit2.h"
+#include "crlf.h"
+
+static git_repository *g_repo = NULL;
+static git_blob_filter_options filter_opts = GIT_BLOB_FILTER_OPTIONS_INIT;
+
+void test_filter_bare__initialize(void)
+{
+	cl_fixture_sandbox("crlf.git");
+	cl_git_pass(git_repository_open(&g_repo, "crlf.git"));
+
+	filter_opts.flags |= GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES;
+	filter_opts.flags |= GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD;
+}
+
+void test_filter_bare__cleanup(void)
+{
+	git_repository_free(g_repo);
+	cl_fixture_cleanup("crlf.git");
+}
+
+void test_filter_bare__all_crlf(void)
+{
+	git_blob *blob;
+	git_buf buf = { 0 };
+
+	cl_git_pass(git_revparse_single(
+		(git_object **)&blob, g_repo, "a9a2e89")); /* all-crlf */
+
+	cl_assert_equal_s(ALL_CRLF_TEXT_RAW, git_blob_rawcontent(blob));
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.bin", &filter_opts));
+
+	cl_assert_equal_s(ALL_CRLF_TEXT_RAW, buf.ptr);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.crlf", &filter_opts));
+
+	/* in this case, raw content has crlf in it already */
+	cl_assert_equal_s(ALL_CRLF_TEXT_AS_CRLF, buf.ptr);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.lf", &filter_opts));
+
+	/* we never convert CRLF -> LF on platforms that have LF */
+	cl_assert_equal_s(ALL_CRLF_TEXT_AS_CRLF, buf.ptr);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.txt", &filter_opts));
+
+	/* in this case, raw content has crlf in it already */
+	cl_assert_equal_s(ALL_CRLF_TEXT_AS_CRLF, buf.ptr);
+
+	git_buf_dispose(&buf);
+	git_blob_free(blob);
+}
+
+void test_filter_bare__from_lf(void)
+{
+	git_blob *blob;
+	git_buf buf = { 0 };
+
+	cl_git_pass(git_revparse_single(
+		(git_object **)&blob, g_repo, "799770d")); /* all-lf */
+
+	cl_assert_equal_s(ALL_LF_TEXT_RAW, git_blob_rawcontent(blob));
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.bin", &filter_opts));
+
+	cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.crlf", &filter_opts));
+
+	/* in this case, raw content has crlf in it already */
+	cl_assert_equal_s(ALL_LF_TEXT_AS_CRLF, buf.ptr);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.lf", &filter_opts));
+
+	/* we never convert CRLF -> LF on platforms that have LF */
+	cl_assert_equal_s(ALL_LF_TEXT_AS_LF, buf.ptr);
+
+	git_buf_dispose(&buf);
+	git_blob_free(blob);
+}
+
+void test_filter_bare__sanitizes(void)
+{
+	git_blob *blob;
+	git_buf buf = GIT_BUF_INIT;
+
+	cl_git_pass(git_revparse_single(
+		(git_object **)&blob, g_repo, "e69de29")); /* zero-byte */
+
+	cl_assert_equal_i(0, git_blob_rawsize(blob));
+	cl_assert_equal_s("", git_blob_rawcontent(blob));
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.bin", &filter_opts));
+	cl_assert_equal_sz(0, buf.size);
+	cl_assert_equal_s("", buf.ptr);
+	git_buf_dispose(&buf);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.crlf", &filter_opts));
+	cl_assert_equal_sz(0, buf.size);
+	cl_assert_equal_s("", buf.ptr);
+	git_buf_dispose(&buf);
+
+	cl_git_pass(git_blob_filter(&buf, blob, "file.lf", &filter_opts));
+	cl_assert_equal_sz(0, buf.size);
+	cl_assert_equal_s("", buf.ptr);
+	git_buf_dispose(&buf);
+
+	git_blob_free(blob);
+}
+
diff --git a/tests/resources/crlf.git/COMMIT_EDITMSG b/tests/resources/crlf.git/COMMIT_EDITMSG
new file mode 100644
index 0000000..f038034
--- /dev/null
+++ b/tests/resources/crlf.git/COMMIT_EDITMSG
@@ -0,0 +1 @@
+Add .gitattributes
diff --git a/tests/resources/crlf.git/HEAD b/tests/resources/crlf.git/HEAD
new file mode 100644
index 0000000..cb089cd
--- /dev/null
+++ b/tests/resources/crlf.git/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master
diff --git a/tests/resources/crlf.git/config b/tests/resources/crlf.git/config
new file mode 100644
index 0000000..8e7c7b4
--- /dev/null
+++ b/tests/resources/crlf.git/config
@@ -0,0 +1,3 @@
+[core]
+	repositoryformatversion = 0
+	bare = true
diff --git a/tests/resources/crlf.git/logs/HEAD b/tests/resources/crlf.git/logs/HEAD
new file mode 100644
index 0000000..3421ae7
--- /dev/null
+++ b/tests/resources/crlf.git/logs/HEAD
@@ -0,0 +1 @@
+5afb6a14a864e30787857dd92af837e8cdd2cb1b 6b9d5748663795f573ea857276eb2a5f8330efa0 Edward Thomson <ethomson@edwardthomson.com> 1561324263 +0100	commit: Add .gitattributes
diff --git a/tests/resources/crlf.git/logs/refs/heads/master b/tests/resources/crlf.git/logs/refs/heads/master
new file mode 100644
index 0000000..3421ae7
--- /dev/null
+++ b/tests/resources/crlf.git/logs/refs/heads/master
@@ -0,0 +1 @@
+5afb6a14a864e30787857dd92af837e8cdd2cb1b 6b9d5748663795f573ea857276eb2a5f8330efa0 Edward Thomson <ethomson@edwardthomson.com> 1561324263 +0100	commit: Add .gitattributes
diff --git a/tests/resources/crlf.git/objects/04/4bcd5c9bf5ebdd51e514a9a36457018f06f6e1 b/tests/resources/crlf.git/objects/04/4bcd5c9bf5ebdd51e514a9a36457018f06f6e1
new file mode 100644
index 0000000..a32a9b2
--- /dev/null
+++ b/tests/resources/crlf.git/objects/04/4bcd5c9bf5ebdd51e514a9a36457018f06f6e1
@@ -0,0 +1 @@
+x-j0D{W4H++C(ɡ]aJU|}̃ʺ.
кVE@vȔvBx=%l
sDxH!x3E9AhPdUTk{k+Av`C2|h괟lR{~/]`z-̥<]M5?]udr&K!
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/04/de00b358f13389948756732158eaaaefa1448c b/tests/resources/crlf.git/objects/04/de00b358f13389948756732158eaaaefa1448c
new file mode 100644
index 0000000..c3b7598
Binary files /dev/null and b/tests/resources/crlf.git/objects/04/de00b358f13389948756732158eaaaefa1448c differ
diff --git a/tests/resources/crlf.git/objects/09/7722be9b67b48dfe3b19396d02fd535300ee46 b/tests/resources/crlf.git/objects/09/7722be9b67b48dfe3b19396d02fd535300ee46
new file mode 100644
index 0000000..5c5c24c
Binary files /dev/null and b/tests/resources/crlf.git/objects/09/7722be9b67b48dfe3b19396d02fd535300ee46 differ
diff --git a/tests/resources/crlf.git/objects/0a/a76e474d259bd7c13eb726a1396c381db55c88 b/tests/resources/crlf.git/objects/0a/a76e474d259bd7c13eb726a1396c381db55c88
new file mode 100644
index 0000000..e118d66
Binary files /dev/null and b/tests/resources/crlf.git/objects/0a/a76e474d259bd7c13eb726a1396c381db55c88 differ
diff --git a/tests/resources/crlf.git/objects/0d/06894e14df22e066763ae906e0ed3eb79c205f b/tests/resources/crlf.git/objects/0d/06894e14df22e066763ae906e0ed3eb79c205f
new file mode 100644
index 0000000..b7a1f32
Binary files /dev/null and b/tests/resources/crlf.git/objects/0d/06894e14df22e066763ae906e0ed3eb79c205f differ
diff --git a/tests/resources/crlf.git/objects/0e/052888828a954ca17e5882638e3c6a083e75c0 b/tests/resources/crlf.git/objects/0e/052888828a954ca17e5882638e3c6a083e75c0
new file mode 100644
index 0000000..746143f
Binary files /dev/null and b/tests/resources/crlf.git/objects/0e/052888828a954ca17e5882638e3c6a083e75c0 differ
diff --git a/tests/resources/crlf.git/objects/0f/f5a53f19bfd2b5eea1ba550295c47515678987 b/tests/resources/crlf.git/objects/0f/f5a53f19bfd2b5eea1ba550295c47515678987
new file mode 100644
index 0000000..5366acd
Binary files /dev/null and b/tests/resources/crlf.git/objects/0f/f5a53f19bfd2b5eea1ba550295c47515678987 differ
diff --git a/tests/resources/crlf.git/objects/16/78031ee023a23bd3515e4e1693b661a69f0a73 b/tests/resources/crlf.git/objects/16/78031ee023a23bd3515e4e1693b661a69f0a73
new file mode 100644
index 0000000..4aa4ffb
Binary files /dev/null and b/tests/resources/crlf.git/objects/16/78031ee023a23bd3515e4e1693b661a69f0a73 differ
diff --git a/tests/resources/crlf.git/objects/16/c72b67861f8524a5bebc05cd20472d3fca00da b/tests/resources/crlf.git/objects/16/c72b67861f8524a5bebc05cd20472d3fca00da
new file mode 100644
index 0000000..e2b1994
Binary files /dev/null and b/tests/resources/crlf.git/objects/16/c72b67861f8524a5bebc05cd20472d3fca00da differ
diff --git a/tests/resources/crlf.git/objects/18/c637c5d9aba6eed226ee1840cd1ca2e6c4e4c5 b/tests/resources/crlf.git/objects/18/c637c5d9aba6eed226ee1840cd1ca2e6c4e4c5
new file mode 100644
index 0000000..790eb13
Binary files /dev/null and b/tests/resources/crlf.git/objects/18/c637c5d9aba6eed226ee1840cd1ca2e6c4e4c5 differ
diff --git a/tests/resources/crlf.git/objects/20/3555c5676d75cd80d69b50beb1f4b588c59ceb b/tests/resources/crlf.git/objects/20/3555c5676d75cd80d69b50beb1f4b588c59ceb
new file mode 100644
index 0000000..8038a9b
Binary files /dev/null and b/tests/resources/crlf.git/objects/20/3555c5676d75cd80d69b50beb1f4b588c59ceb differ
diff --git a/tests/resources/crlf.git/objects/23/f4582779e60bfa7f14750ad507399a58876611 b/tests/resources/crlf.git/objects/23/f4582779e60bfa7f14750ad507399a58876611
new file mode 100644
index 0000000..4a4e4dc
Binary files /dev/null and b/tests/resources/crlf.git/objects/23/f4582779e60bfa7f14750ad507399a58876611 differ
diff --git a/tests/resources/crlf.git/objects/2a/d3df895f68f4dda6a0a815c620b909bdd27c05 b/tests/resources/crlf.git/objects/2a/d3df895f68f4dda6a0a815c620b909bdd27c05
new file mode 100644
index 0000000..f5421cf
Binary files /dev/null and b/tests/resources/crlf.git/objects/2a/d3df895f68f4dda6a0a815c620b909bdd27c05 differ
diff --git a/tests/resources/crlf.git/objects/2b/55b4b94f655c857635b6a9005c056aa7de3532 b/tests/resources/crlf.git/objects/2b/55b4b94f655c857635b6a9005c056aa7de3532
new file mode 100644
index 0000000..031fd66
--- /dev/null
+++ b/tests/resources/crlf.git/objects/2b/55b4b94f655c857635b6a9005c056aa7de3532
@@ -0,0 +1,2 @@
+x-Kj0D)z2tca].OVȄ	zRݶԛAvyIfLi.υPɘL0d<=&b{O.09o4ŜI˔
+G_jk	-Yھ~XTW ذNjqKu:_ǣ]na.ZZk7!<#WF
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/2b/d9d81b51a867352bab307b89cbb5b4a69adfe1 b/tests/resources/crlf.git/objects/2b/d9d81b51a867352bab307b89cbb5b4a69adfe1
new file mode 100644
index 0000000..96d952e
Binary files /dev/null and b/tests/resources/crlf.git/objects/2b/d9d81b51a867352bab307b89cbb5b4a69adfe1 differ
diff --git a/tests/resources/crlf.git/objects/2c/03f9f407b576eae80327864bab572e282a33ea b/tests/resources/crlf.git/objects/2c/03f9f407b576eae80327864bab572e282a33ea
new file mode 100644
index 0000000..0e4afbb
Binary files /dev/null and b/tests/resources/crlf.git/objects/2c/03f9f407b576eae80327864bab572e282a33ea differ
diff --git a/tests/resources/crlf.git/objects/33/cdead44e1c3ec178e39a4a69085280dbacf01b b/tests/resources/crlf.git/objects/33/cdead44e1c3ec178e39a4a69085280dbacf01b
new file mode 100644
index 0000000..72dc780
Binary files /dev/null and b/tests/resources/crlf.git/objects/33/cdead44e1c3ec178e39a4a69085280dbacf01b differ
diff --git a/tests/resources/crlf.git/objects/38/1cfe630df902bc29271a202d3277981180e4a6 b/tests/resources/crlf.git/objects/38/1cfe630df902bc29271a202d3277981180e4a6
new file mode 100644
index 0000000..0cf7072
Binary files /dev/null and b/tests/resources/crlf.git/objects/38/1cfe630df902bc29271a202d3277981180e4a6 differ
diff --git a/tests/resources/crlf.git/objects/3f/96bdca0e37616026afaa325c148cec4aa62d04 b/tests/resources/crlf.git/objects/3f/96bdca0e37616026afaa325c148cec4aa62d04
new file mode 100644
index 0000000..a204fc9
Binary files /dev/null and b/tests/resources/crlf.git/objects/3f/96bdca0e37616026afaa325c148cec4aa62d04 differ
diff --git a/tests/resources/crlf.git/objects/41/7786fc35b3c71aa546e3f95eb5da3c8dad8c41 b/tests/resources/crlf.git/objects/41/7786fc35b3c71aa546e3f95eb5da3c8dad8c41
new file mode 100644
index 0000000..ec57bde
Binary files /dev/null and b/tests/resources/crlf.git/objects/41/7786fc35b3c71aa546e3f95eb5da3c8dad8c41 differ
diff --git a/tests/resources/crlf.git/objects/47/fbc2c28a18df0dc773276a253eb85c7516ca50 b/tests/resources/crlf.git/objects/47/fbc2c28a18df0dc773276a253eb85c7516ca50
new file mode 100644
index 0000000..d16db96
Binary files /dev/null and b/tests/resources/crlf.git/objects/47/fbc2c28a18df0dc773276a253eb85c7516ca50 differ
diff --git a/tests/resources/crlf.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/tests/resources/crlf.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
new file mode 100644
index 0000000..adf6411
Binary files /dev/null and b/tests/resources/crlf.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 differ
diff --git a/tests/resources/crlf.git/objects/5a/fb6a14a864e30787857dd92af837e8cdd2cb1b b/tests/resources/crlf.git/objects/5a/fb6a14a864e30787857dd92af837e8cdd2cb1b
new file mode 100644
index 0000000..11a25c5
Binary files /dev/null and b/tests/resources/crlf.git/objects/5a/fb6a14a864e30787857dd92af837e8cdd2cb1b differ
diff --git a/tests/resources/crlf.git/objects/68/03c385642cebc8103fddd526ef395d75678a7e b/tests/resources/crlf.git/objects/68/03c385642cebc8103fddd526ef395d75678a7e
new file mode 100644
index 0000000..f8d489f
--- /dev/null
+++ b/tests/resources/crlf.git/objects/68/03c385642cebc8103fddd526ef395d75678a7e
@@ -0,0 +1,2 @@
+xKj0Ьu},!d	&hZ0QvgWuz9OAHvBh9!EM}cf52v%m`/=ZËMoeV3
+fr1pѓj8.[_
K^@kѡYj
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e b/tests/resources/crlf.git/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e
new file mode 100644
index 0000000..ee4f427
--- /dev/null
+++ b/tests/resources/crlf.git/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e
@@ -0,0 +1 @@
+xэ0a3Owr&%`NĎ-J!1|si`ݸkUȢr.*{zgr>ɱcbn\ui c.x"D,N,VuՒ.umgzL=@[kIǦismbY>!nJL
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/6a/e3e9c11a51f0aabebcffcbd5c00f4beed143c9 b/tests/resources/crlf.git/objects/6a/e3e9c11a51f0aabebcffcbd5c00f4beed143c9
new file mode 100644
index 0000000..6c18a3a
Binary files /dev/null and b/tests/resources/crlf.git/objects/6a/e3e9c11a51f0aabebcffcbd5c00f4beed143c9 differ
diff --git a/tests/resources/crlf.git/objects/6b/9d5748663795f573ea857276eb2a5f8330efa0 b/tests/resources/crlf.git/objects/6b/9d5748663795f573ea857276eb2a5f8330efa0
new file mode 100644
index 0000000..680c7cd
--- /dev/null
+++ b/tests/resources/crlf.git/objects/6b/9d5748663795f573ea857276eb2a5f8330efa0
@@ -0,0 +1 @@
+xK0CYGk>B\`ҙ.ڠ0S7`g?˖,N3q1=GN:e[Rb	3{6ꎍWxL1GlqLnkDv((|T\腍:QW8F?纡.G0}0zZmt;+:AwE\YSm
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc b/tests/resources/crlf.git/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc
new file mode 100644
index 0000000..fe4da8c
--- /dev/null
+++ b/tests/resources/crlf.git/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc
@@ -0,0 +1,2 @@
+x-KN0Y;PYpr5j#ǀ=nnF3iUUp$dKbN)OL)`Pf'VpCVY$SճcqVI:W
+oZ^tvӁGW9gL2<kM+Ko	|\ʺ;Nݱ>$81ÛeUer}.Q
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/72/10e91413baa3d9b90215e970ae53397ecc526e b/tests/resources/crlf.git/objects/72/10e91413baa3d9b90215e970ae53397ecc526e
new file mode 100644
index 0000000..38c000d
Binary files /dev/null and b/tests/resources/crlf.git/objects/72/10e91413baa3d9b90215e970ae53397ecc526e differ
diff --git a/tests/resources/crlf.git/objects/77/afe26d93c49279ca90604c125496920753fede b/tests/resources/crlf.git/objects/77/afe26d93c49279ca90604c125496920753fede
new file mode 100644
index 0000000..a377cb0
Binary files /dev/null and b/tests/resources/crlf.git/objects/77/afe26d93c49279ca90604c125496920753fede differ
diff --git a/tests/resources/crlf.git/objects/78/db270c1841841f75a8157321bdcb50ab12e6c3 b/tests/resources/crlf.git/objects/78/db270c1841841f75a8157321bdcb50ab12e6c3
new file mode 100644
index 0000000..8a55bb0
Binary files /dev/null and b/tests/resources/crlf.git/objects/78/db270c1841841f75a8157321bdcb50ab12e6c3 differ
diff --git a/tests/resources/crlf.git/objects/79/9770d1cff46753a57db7a066159b5610da6e3a b/tests/resources/crlf.git/objects/79/9770d1cff46753a57db7a066159b5610da6e3a
new file mode 100644
index 0000000..5c701b8
Binary files /dev/null and b/tests/resources/crlf.git/objects/79/9770d1cff46753a57db7a066159b5610da6e3a differ
diff --git a/tests/resources/crlf.git/objects/7c/ce67e58173e2b01f7db124ceaabe3183d19c49 b/tests/resources/crlf.git/objects/7c/ce67e58173e2b01f7db124ceaabe3183d19c49
new file mode 100644
index 0000000..8e836ab
Binary files /dev/null and b/tests/resources/crlf.git/objects/7c/ce67e58173e2b01f7db124ceaabe3183d19c49 differ
diff --git a/tests/resources/crlf.git/objects/85/340755cfe5e28c2835781978bb1cece91b3d0f b/tests/resources/crlf.git/objects/85/340755cfe5e28c2835781978bb1cece91b3d0f
new file mode 100644
index 0000000..e83fbc2
Binary files /dev/null and b/tests/resources/crlf.git/objects/85/340755cfe5e28c2835781978bb1cece91b3d0f differ
diff --git a/tests/resources/crlf.git/objects/92/0e90a663bea5d740989d5f935f6dfb473a0c5d b/tests/resources/crlf.git/objects/92/0e90a663bea5d740989d5f935f6dfb473a0c5d
new file mode 100644
index 0000000..f872be6
Binary files /dev/null and b/tests/resources/crlf.git/objects/92/0e90a663bea5d740989d5f935f6dfb473a0c5d differ
diff --git a/tests/resources/crlf.git/objects/96/87e444bcbb85645cb496080434c292f1b57182 b/tests/resources/crlf.git/objects/96/87e444bcbb85645cb496080434c292f1b57182
new file mode 100644
index 0000000..5df64d8
--- /dev/null
+++ b/tests/resources/crlf.git/objects/96/87e444bcbb85645cb496080434c292f1b57182
@@ -0,0 +1 @@
+xAJ1@Q9E!T:Y	ޢRMAoGp/m7L*LQ)yEU(JqfP2Q1%L$QS	,xѾoz|xz󰾱I0{S@x轻}_wU+H50'2=T
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/97/449da2d225557c558ac244384d487e66c3e591 b/tests/resources/crlf.git/objects/97/449da2d225557c558ac244384d487e66c3e591
new file mode 100644
index 0000000..d3917a4
Binary files /dev/null and b/tests/resources/crlf.git/objects/97/449da2d225557c558ac244384d487e66c3e591 differ
diff --git a/tests/resources/crlf.git/objects/9a/6c3533fef19abd6eec8e61206b5c51982b80d9 b/tests/resources/crlf.git/objects/9a/6c3533fef19abd6eec8e61206b5c51982b80d9
new file mode 100644
index 0000000..78fc8ae
Binary files /dev/null and b/tests/resources/crlf.git/objects/9a/6c3533fef19abd6eec8e61206b5c51982b80d9 differ
diff --git a/tests/resources/crlf.git/objects/9d/29b5bb165bf65637ffcb5ededb82ddd7c3fd13 b/tests/resources/crlf.git/objects/9d/29b5bb165bf65637ffcb5ededb82ddd7c3fd13
new file mode 100644
index 0000000..106332d
Binary files /dev/null and b/tests/resources/crlf.git/objects/9d/29b5bb165bf65637ffcb5ededb82ddd7c3fd13 differ
diff --git a/tests/resources/crlf.git/objects/a2/34455d62297f1856c4603686150c59fcb0aafe b/tests/resources/crlf.git/objects/a2/34455d62297f1856c4603686150c59fcb0aafe
new file mode 100644
index 0000000..7d204f4
Binary files /dev/null and b/tests/resources/crlf.git/objects/a2/34455d62297f1856c4603686150c59fcb0aafe differ
diff --git a/tests/resources/crlf.git/objects/a9/a2e8913c1dbe2812fac5e6b4e0a4bd5d0d5966 b/tests/resources/crlf.git/objects/a9/a2e8913c1dbe2812fac5e6b4e0a4bd5d0d5966
new file mode 100644
index 0000000..33d59f1
--- /dev/null
+++ b/tests/resources/crlf.git/objects/a9/a2e8913c1dbe2812fac5e6b4e0a4bd5d0d5966
@@ -0,0 +1 @@
+xKOR02aH.I$	
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/aa/f083a9cb53dac3669dcfa0e48921580d629ec7 b/tests/resources/crlf.git/objects/aa/f083a9cb53dac3669dcfa0e48921580d629ec7
new file mode 100644
index 0000000..38775d0
Binary files /dev/null and b/tests/resources/crlf.git/objects/aa/f083a9cb53dac3669dcfa0e48921580d629ec7 differ
diff --git a/tests/resources/crlf.git/objects/af/6fcf6da196f615d7cda269b55b5c4ecfb4a5b3 b/tests/resources/crlf.git/objects/af/6fcf6da196f615d7cda269b55b5c4ecfb4a5b3
new file mode 100644
index 0000000..0acc974
Binary files /dev/null and b/tests/resources/crlf.git/objects/af/6fcf6da196f615d7cda269b55b5c4ecfb4a5b3 differ
diff --git a/tests/resources/crlf.git/objects/bb/29a7b46b5d4ba3ea17b238ae561b81d59dc818 b/tests/resources/crlf.git/objects/bb/29a7b46b5d4ba3ea17b238ae561b81d59dc818
new file mode 100644
index 0000000..a08789b
Binary files /dev/null and b/tests/resources/crlf.git/objects/bb/29a7b46b5d4ba3ea17b238ae561b81d59dc818 differ
diff --git a/tests/resources/crlf.git/objects/c3/e11722855ff260bd27418988ac1467c4e9e73a b/tests/resources/crlf.git/objects/c3/e11722855ff260bd27418988ac1467c4e9e73a
new file mode 100644
index 0000000..5f96dc7
Binary files /dev/null and b/tests/resources/crlf.git/objects/c3/e11722855ff260bd27418988ac1467c4e9e73a differ
diff --git a/tests/resources/crlf.git/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe b/tests/resources/crlf.git/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe
new file mode 100644
index 0000000..21e2ce0
--- /dev/null
+++ b/tests/resources/crlf.git/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe
@@ -0,0 +1,2 @@
+x-Kn0C)f8od(t4#؈e9~;$RKI1*1;tf9Edb&1LʈPyk 0#*FeYtٱ{7opkuI^ec3Z?	NRI)c
+[^}|+?wTX
#ވ,L!5C^V>=R~
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/cd/574f5a2baa4c79504f8837b730fa0b11defe99 b/tests/resources/crlf.git/objects/cd/574f5a2baa4c79504f8837b730fa0b11defe99
new file mode 100644
index 0000000..e8d0202
Binary files /dev/null and b/tests/resources/crlf.git/objects/cd/574f5a2baa4c79504f8837b730fa0b11defe99 differ
diff --git a/tests/resources/crlf.git/objects/cd/d3dacc5c0501d5ea57bbdf90e3d80176606139 b/tests/resources/crlf.git/objects/cd/d3dacc5c0501d5ea57bbdf90e3d80176606139
new file mode 100644
index 0000000..72cf3b0
Binary files /dev/null and b/tests/resources/crlf.git/objects/cd/d3dacc5c0501d5ea57bbdf90e3d80176606139 differ
diff --git a/tests/resources/crlf.git/objects/d1/1e7ef63ba7db1db3b1b99cdbafc57a8549f8a4 b/tests/resources/crlf.git/objects/d1/1e7ef63ba7db1db3b1b99cdbafc57a8549f8a4
new file mode 100644
index 0000000..05d88fc
Binary files /dev/null and b/tests/resources/crlf.git/objects/d1/1e7ef63ba7db1db3b1b99cdbafc57a8549f8a4 differ
diff --git a/tests/resources/crlf.git/objects/dc/88e3b917de821e25962bea7ec1f55c4ce2112c b/tests/resources/crlf.git/objects/dc/88e3b917de821e25962bea7ec1f55c4ce2112c
new file mode 100644
index 0000000..3db13aa
Binary files /dev/null and b/tests/resources/crlf.git/objects/dc/88e3b917de821e25962bea7ec1f55c4ce2112c differ
diff --git a/tests/resources/crlf.git/objects/de/5bfa165999d9d6c6dbafad2a7e709f93ec30fd b/tests/resources/crlf.git/objects/de/5bfa165999d9d6c6dbafad2a7e709f93ec30fd
new file mode 100644
index 0000000..e288b97
Binary files /dev/null and b/tests/resources/crlf.git/objects/de/5bfa165999d9d6c6dbafad2a7e709f93ec30fd differ
diff --git a/tests/resources/crlf.git/objects/e1/379fd9942d04e7e80892b866d37bdb7da9e4e1 b/tests/resources/crlf.git/objects/e1/379fd9942d04e7e80892b866d37bdb7da9e4e1
new file mode 100644
index 0000000..01f8745
Binary files /dev/null and b/tests/resources/crlf.git/objects/e1/379fd9942d04e7e80892b866d37bdb7da9e4e1 differ
diff --git a/tests/resources/crlf.git/objects/e5/062da7d7802cf492975eda580f09ac4876bd88 b/tests/resources/crlf.git/objects/e5/062da7d7802cf492975eda580f09ac4876bd88
new file mode 100644
index 0000000..62835b9
--- /dev/null
+++ b/tests/resources/crlf.git/objects/e5/062da7d7802cf492975eda580f09ac4876bd88
@@ -0,0 +1 @@
+xQ1D)j'd2")xN,3x^AQj)UD`iJֻ>Fc:D&Rr.1#DǓ,HPϖ}9rPGŏ6	~a/}IDx$kj&_֨GZכ›|ǸU
\ No newline at end of file
diff --git a/tests/resources/crlf.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/tests/resources/crlf.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
new file mode 100644
index 0000000..7112238
Binary files /dev/null and b/tests/resources/crlf.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 differ
diff --git a/tests/resources/crlf.git/objects/ea/030d3c6cec212069eca698cabaa5b4550f1511 b/tests/resources/crlf.git/objects/ea/030d3c6cec212069eca698cabaa5b4550f1511
new file mode 100644
index 0000000..117dc72
Binary files /dev/null and b/tests/resources/crlf.git/objects/ea/030d3c6cec212069eca698cabaa5b4550f1511 differ
diff --git a/tests/resources/crlf.git/objects/ef/0dcd356d77221e9c27f4f3928ad28e80b87ceb b/tests/resources/crlf.git/objects/ef/0dcd356d77221e9c27f4f3928ad28e80b87ceb
new file mode 100644
index 0000000..33aceda
Binary files /dev/null and b/tests/resources/crlf.git/objects/ef/0dcd356d77221e9c27f4f3928ad28e80b87ceb differ
diff --git a/tests/resources/crlf.git/objects/f2/b745d7f47d114a3a6b31a7b628e61e804d1a58 b/tests/resources/crlf.git/objects/f2/b745d7f47d114a3a6b31a7b628e61e804d1a58
new file mode 100644
index 0000000..7b2e7a1
Binary files /dev/null and b/tests/resources/crlf.git/objects/f2/b745d7f47d114a3a6b31a7b628e61e804d1a58 differ
diff --git a/tests/resources/crlf.git/objects/f4/d25b796d86387205a5498175d66e91d1e5006a b/tests/resources/crlf.git/objects/f4/d25b796d86387205a5498175d66e91d1e5006a
new file mode 100644
index 0000000..792b165
Binary files /dev/null and b/tests/resources/crlf.git/objects/f4/d25b796d86387205a5498175d66e91d1e5006a differ
diff --git a/tests/resources/crlf.git/objects/fe/085d9ace90cc675b87df15e1aeed0c3a31407f b/tests/resources/crlf.git/objects/fe/085d9ace90cc675b87df15e1aeed0c3a31407f
new file mode 100644
index 0000000..2e8d10b
Binary files /dev/null and b/tests/resources/crlf.git/objects/fe/085d9ace90cc675b87df15e1aeed0c3a31407f differ
diff --git a/tests/resources/crlf.git/objects/fe/ab3713c4659bb22700042b3c55b8d60d0a952b b/tests/resources/crlf.git/objects/fe/ab3713c4659bb22700042b3c55b8d60d0a952b
new file mode 100644
index 0000000..8552c7b
Binary files /dev/null and b/tests/resources/crlf.git/objects/fe/ab3713c4659bb22700042b3c55b8d60d0a952b differ
diff --git a/tests/resources/crlf.git/refs/heads/empty-files b/tests/resources/crlf.git/refs/heads/empty-files
new file mode 100644
index 0000000..8f1fe61
--- /dev/null
+++ b/tests/resources/crlf.git/refs/heads/empty-files
@@ -0,0 +1 @@
+9687e444bcbb85645cb496080434c292f1b57182
diff --git a/tests/resources/crlf.git/refs/heads/master b/tests/resources/crlf.git/refs/heads/master
new file mode 100644
index 0000000..a35e8be
--- /dev/null
+++ b/tests/resources/crlf.git/refs/heads/master
@@ -0,0 +1 @@
+6b9d5748663795f573ea857276eb2a5f8330efa0