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