Skip to content

manually merge PR by fast-forward crashes gitea #1964

@grissiom

Description

@grissiom
  • Gitea version (or commit ref): 1.1.2
  • Git version: 2.11
  • Operating system: Windows
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    Sorry that the log is on the working machine which could not access the Internet easily,

Description

https://github.com/go-gitea/gitea/blob/v1.1.2/models/pull.go#L520 assume the mergeCommit is not empty. But if the PR is merged manually by fast-forward, git rev-list --ancestry-path --merges ... will give empty output. So mergeCommit[:40] will crash the program by index out of range error.

I hope I've provided enough information. If you need the full log etc., please tell me and I will try to get more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions