Closed
Description
- 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:
- Create an organization with some repo to which you have write access.
- Create a branch directly in the repository (not by fork) and make some changes.
- Push the changes remote, so that it's available on gitea.
- 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. ✌