-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Make compare button URL aware if current repo is a fork (#2162) #2163
Make compare button URL aware if current repo is a fork (#2162) #2163
Conversation
Thanks for PR, I hope you don't mind that did a small code optimization. Tested and works just fine, so LGTM |
Not at all. :) Thanks for the quick response. ✌️ |
@Weyzu I was thinking and maybe check IsFork is not needed but only check if signed in user has fork of base repository. What do you think? |
LGTM |
…ill redirect to wrong page
I removed check for IsFork as otherwise if user would click button form fork that he is not owner and that user has no its own fork it would still get 404 error so check explicitly that user has fork |
- The name could be conflucted with the `GET /user/applications/oauth2/{id}` operation, as it only differed in a single letter being uppercase. Change it to be userGetOAuth2Application**s**, as that's also more accurate for this function. - Resolves go-gitea#2163 (cherry picked from commit 1891dac5478f095453c4e1eb3b884926b5344deb) (cherry picked from commit 68fceb9b7a34246a33cdbc2d6669ce80d310f4e9) (cherry picked from commit 7335d6de543e1f3b1dfbbc97acf1be79699dc3c9)
The following merge request fixes the issue addressed in #2162.
Long story short: The change prevents 404 when the template tries to compare non-existing branch by assuming that every repo is a fork (i.e. by providing
username:branchname
every time).Since it was possible to determine if the repository is a fork from within the template, I've added a check in the
home
template. I'm not aware of any side effects of this solution.