+1
-1
gitdiff/file_header.go
+1
-1
gitdiff/file_header.go
+3
-3
gitdiff/parser.go
+3
-3
gitdiff/parser.go
+16
-2
gitdiff/parser_test.go
+16
-2
gitdiff/parser_test.go
···
281
281
--- could this be a header?
282
282
nope, it's just some dashes
283
283
`,
284
-
Output: nil,
285
-
Preamble: "",
284
+
Output: nil,
285
+
Preamble: `
286
+
this is a line
287
+
this is another line
288
+
--- could this be a header?
289
+
nope, it's just some dashes
290
+
`,
286
291
},
287
292
"detatchedFragmentLike": {
288
293
Input: `
···
290
295
@@ -1,3 +1,4 ~1,5 @@
291
296
`,
292
297
Output: nil,
298
+
Preamble: `
299
+
a wild fragment appears?
300
+
@@ -1,3 +1,4 ~1,5 @@
301
+
`,
293
302
},
294
303
"detatchedFragment": {
295
304
Input: `
···
425
434
},
426
435
},
427
436
Preamble: textPreamble,
437
+
},
438
+
"noFiles": {
439
+
InputFile: "testdata/no_files.patch",
440
+
Output: nil,
441
+
Preamble: textPreamble,
428
442
},
429
443
"newBinaryFile": {
430
444
InputFile: "testdata/new_binary_file.patch",