fork of go-gitdiff with jj support

Fix panic with empty input in LineReaderAt

Changed files
+8 -1
gitdiff
+1 -1
gitdiff/io.go
··· 47 47 return 0, err 48 48 } 49 49 } 50 - if startLine > int64(len(r.index)) { 50 + if startLine >= int64(len(r.index)) { 51 51 return 0, io.EOF 52 52 } 53 53
+7
gitdiff/io_test.go
··· 48 48 EOF: true, 49 49 EOFCount: 4, 50 50 }, 51 + "emptyInput": { 52 + InputLines: 0, 53 + Offset: 0, 54 + Count: 2, 55 + EOF: true, 56 + EOFCount: 0, 57 + }, 51 58 "offsetAfterEOF": { 52 59 InputLines: 8, 53 60 Offset: 10,