Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 when creating pull request directly on organization repository #2162

Closed
2 of 7 tasks
Weyzu opened this issue Jul 13, 2017 · 1 comment
Closed
2 of 7 tasks

404 when creating pull request directly on organization repository #2162

Weyzu opened this issue Jul 13, 2017 · 1 comment
Labels
Milestone

Comments

@Weyzu
Copy link
Contributor

Weyzu commented Jul 13, 2017

  • 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. ✌

@lunny lunny added this to the 1.3.0 milestone Jul 14, 2017
lunny pushed a commit that referenced this issue Jul 15, 2017
* Make compare button URL aware if current repo is a fork (#2162)

* Optimize code

* To not change current behaviour check if signed in user has fork of base repository

* Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page
@lunny lunny modified the milestones: 1.2.0, 1.3.0 Jul 15, 2017
@lunny
Copy link
Member

lunny commented Jul 15, 2017

resolved by #2163

@lunny lunny closed this as completed Jul 15, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants