* 7184- message if line too long * Update options/locale/locale_en-US.ini Co-authored-by: silverwind <me@silverwind.io> * add flag on missing cases Signed-off-by: Andrew Thornton <art27@cantab.net>
Showing the changes to services/gitdiff/gitdiff.go (1 of 3 files). Show all
Unified · Split
| @@ -574,21 +574,22 @@ func (diffSection *DiffSection) GetComputedInlineDiffFor(diffLine *DiffLine) tem · 573 unmodified lines | |||
| 574 | 574 | ||
| 575 | // DiffFile represents a file diff. | 575 | // DiffFile represents a file diff. |
| 576 | type DiffFile struct { | 576 | type DiffFile struct { |
| 577 | Name string | 577 | Name string |
| 578 | OldName string | 578 | OldName string |
| 579 | Index int | 579 | Index int |
| 580 | Addition, Deletion int | 580 | Addition, Deletion int |
| 581 | Type DiffFileType | 581 | Type DiffFileType |
| 582 | IsCreated bool | 582 | IsCreated bool |
| 583 | IsDeleted bool | 583 | IsDeleted bool |
| 584 | IsBin bool | 584 | IsBin bool |
| 585 | IsLFSFile bool | 585 | IsLFSFile bool |
| 586 | IsRenamed bool | 586 | IsRenamed bool |
| 587 | IsAmbiguous bool | 587 | IsAmbiguous bool |
| 588 | IsSubmodule bool | 588 | IsSubmodule bool |
| 589 | Sections []*DiffSection | 589 | Sections []*DiffSection |
| 590 | IsIncomplete bool | 590 | IsIncomplete bool |
| 591 | IsProtected bool | 591 | IsIncompleteLineTooLong bool |
| 592 | IsProtected bool | ||
| 592 | } | 593 | } |
| 593 | 594 | ||
| 594 | // GetType returns type of diff file. | 595 | // GetType returns type of diff file. |
| @@ -935,6 +936,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 340 unmodified lines | |||
| 935 | for { | 936 | for { |
| 936 | for isFragment { | 937 | for isFragment { |
| 937 | curFile.IsIncomplete = true | 938 | curFile.IsIncomplete = true |
| 939 | curFile.IsIncompleteLineTooLong = true | ||
| 938 | _, isFragment, err = input.ReadLine() | 940 | _, isFragment, err = input.ReadLine() |
| 939 | if err != nil { | 941 | if err != nil { |
| 940 | // Now by the definition of ReadLine this cannot be io.EOF | 942 | // Now by the definition of ReadLine this cannot be io.EOF |
| @@ -1062,6 +1064,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 121 unmodified lines | |||
| 1062 | line := string(lineBytes) | 1064 | line := string(lineBytes) |
| 1063 | if isFragment { | 1065 | if isFragment { |
| 1064 | curFile.IsIncomplete = true | 1066 | curFile.IsIncomplete = true |
| 1067 | curFile.IsIncompleteLineTooLong = true | ||
| 1065 | for isFragment { | 1068 | for isFragment { |
| 1066 | lineBytes, isFragment, err = input.ReadLine() | 1069 | lineBytes, isFragment, err = input.ReadLine() |
| 1067 | if err != nil { | 1070 | if err != nil { |
| @@ -1073,6 +1076,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 5 unmodified lines | |||
| 1073 | } | 1076 | } |
| 1074 | if len(line) > maxLineCharacters { | 1077 | if len(line) > maxLineCharacters { |
| 1075 | curFile.IsIncomplete = true | 1078 | curFile.IsIncomplete = true |
| 1079 | curFile.IsIncompleteLineTooLong = true | ||
| 1076 | line = line[:maxLineCharacters] | 1080 | line = line[:maxLineCharacters] |
| 1077 | } | 1081 | } |
| 1078 | curSection.Lines[len(curSection.Lines)-1].Content = line | 1082 | curSection.Lines[len(curSection.Lines)-1].Content = line |