Skip to content

Commit dbc5a88

Browse files
committed
Remove unreachable code.
Fixes #7. Fixes Travis build.
1 parent a12082f commit dbc5a88

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

diff/parse.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ func (r *HunksReader) ReadHunk() (*Hunk, error) {
365365
if r.hunk == nil {
366366
// Check for presence of hunk header.
367367
if !bytes.HasPrefix(line, hunkPrefix) {
368-
panic("X")
369368
return nil, &ParseError{r.line, r.offset, ErrNoHunkHeader}
370369
}
371370

@@ -436,12 +435,6 @@ func (r *HunksReader) ReadHunk() (*Hunk, error) {
436435
r.hunk.Body = append(r.hunk.Body, '\n')
437436
}
438437
}
439-
440-
// Final hunk is complete. But if we never saw a hunk in this call to ReadHunk, then it means we hit EOF.
441-
if r.hunk != nil {
442-
return r.hunk, nil
443-
}
444-
return nil, io.EOF
445438
}
446439

447440
const noNewlineMessage = `\ No newline at end of file`

0 commit comments

Comments
 (0)