Skip to content

Error creating pull requests or diffs with very long diffs containing very long lines #13602

@davidsvantesson

Description

@davidsvantesson
  • Gitea version (or commit ref): 1.12.6
  • Git version:
  • Operating system: Ubuntu
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
    2020/11/17 10:12:48 ...ters/repo/compare.go:449:PrepareCompareDiff() [E] GetDiffRange: ParsePatch: Unexpected line in hunk: <line containing /// characters>

Description

When creating a PR with a file containing a "//" this will cause a 500 error page. Issue was introduced with #13157 (see services/gitdiff/gitdiff.go line 671).
Suggested solution: Even if this is considered not valid, it should only affect the specific file (For example with a text "Gitea can't generate a diff for this file"). It should not cause a 500 error page making it impossible to create PR.

This is similar to #13597 but seem to be related to LFS, so I decided to create a new issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions