Browse Source

Check if diff actually contains sections when rendering (#9926)

for-closed-social
Lauris BH 4 years ago
committed by GitHub
parent
commit
3185a13ea5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      services/gitdiff/gitdiff.go

+ 1
- 1
services/gitdiff/gitdiff.go View File

@ -344,7 +344,7 @@ func (diffFile *DiffFile) GetHighlightClass() string {
// GetTailSection creates a fake DiffLineSection if the last section is not the end of the file
func (diffFile *DiffFile) GetTailSection(gitRepo *git.Repository, leftCommitID, rightCommitID string) *DiffSection {
if diffFile.Type != DiffFileChange || diffFile.IsBin || diffFile.IsLFSFile {
if len(diffFile.Sections) == 0 || diffFile.Type != DiffFileChange || diffFile.IsBin || diffFile.IsLFSFile {
return nil
}
leftCommit, err := gitRepo.GetCommit(leftCommitID)

Loading…
Cancel
Save