Skip to content

404 when creating pull request directly on organization repository #2162

Closed
@Weyzu

Description

@Weyzu
  • Gitea version (or commit ref): 6a3c037
  • Git version: 2.13.1
  • Operating system: Arch Linux
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: N/A

Site throws 404 for certain branches after an attempt to display a compare page within a repo. A repo of which you're not the owner but have the right to create pull requests. Steps to reproduce the error:

  1. Create an organization with some repo to which you have write access.
  2. Create a branch directly in the repository (not by fork) and make some changes.
  3. Push the changes remote, so that it's available on gitea.
  4. Click compare branches below the repo description to open the compare page.

After the 4th step, a 404 should be thrown. What frontend tries to do is to assume that we would always merge from a fork, not directly on the repo, so it provides wrong upstream path, e.g.

organization:master..username:branch

instead of just

organization:master..branch

What it should do is to check whether the currently viewed repo is a fork. If it is, pass the first option. If not, pass the second one.

I will drop a fix for that in a matter of minutes. ✌

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