* 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 | 575 | // DiffFile represents a file diff. |
| 576 | 576 | type DiffFile struct { |
| 577 | − Name string | |
| 578 | − OldName string | |
| 579 | − Index int | |
| 580 | − Addition, Deletion int | |
| 581 | − Type DiffFileType | |
| 582 | − IsCreated bool | |
| 583 | − IsDeleted bool | |
| 584 | − IsBin bool | |
| 585 | − IsLFSFile bool | |
| 586 | − IsRenamed bool | |
| 587 | − IsAmbiguous bool | |
| 588 | − IsSubmodule bool | |
| 589 | − Sections []*DiffSection | |
| 590 | − IsIncomplete bool | |
| 591 | − IsProtected bool | |
| 577 | + Name string | |
| 578 | + OldName string | |
| 579 | + Index int | |
| 580 | + Addition, Deletion int | |
| 581 | + Type DiffFileType | |
| 582 | + IsCreated bool | |
| 583 | + IsDeleted bool | |
| 584 | + IsBin bool | |
| 585 | + IsLFSFile bool | |
| 586 | + IsRenamed bool | |
| 587 | + IsAmbiguous bool | |
| 588 | + IsSubmodule bool | |
| 589 | + Sections []*DiffSection | |
| 590 | + IsIncomplete bool | |
| 591 | + IsIncompleteLineTooLong bool | |
| 592 | + IsProtected bool | |
| 592 | 593 | } |
| 593 | 594 | |
| 594 | 595 | // GetType returns type of diff file. |
| @@ -935,6 +936,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 340 unmodified lines | ||
| 935 | 936 | for { |
| 936 | 937 | for isFragment { |
| 937 | 938 | curFile.IsIncomplete = true |
| 939 | + curFile.IsIncompleteLineTooLong = true | |
| 938 | 940 | _, isFragment, err = input.ReadLine() |
| 939 | 941 | if err != nil { |
| 940 | 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 | 1064 | line := string(lineBytes) |
| 1063 | 1065 | if isFragment { |
| 1064 | 1066 | curFile.IsIncomplete = true |
| 1067 | + curFile.IsIncompleteLineTooLong = true | |
| 1065 | 1068 | for isFragment { |
| 1066 | 1069 | lineBytes, isFragment, err = input.ReadLine() |
| 1067 | 1070 | if err != nil { |
| @@ -1073,6 +1076,7 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio · 5 unmodified lines | ||
| 1073 | 1076 | } |
| 1074 | 1077 | if len(line) > maxLineCharacters { |
| 1075 | 1078 | curFile.IsIncomplete = true |
| 1079 | + curFile.IsIncompleteLineTooLong = true | |
| 1076 | 1080 | line = line[:maxLineCharacters] |
| 1077 | 1081 | } |
| 1078 | 1082 | curSection.Lines[len(curSection.Lines)-1].Content = line |