Make compare button URL aware if current repo is a fork (#2162) - #2163
Merged
lunny merged 4 commits intoJul 15, 2017
Merged
Conversation
Member
|
Thanks for PR, I hope you don't mind that did a small code optimization. Tested and works just fine, so LGTM |
Contributor
Author
|
Not at all. :) Thanks for the quick response. ✌️ |
Member
|
@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? |
Member
|
LGTM |
sapk
approved these changes
Jul 14, 2017
…ill redirect to wrong page
Member
|
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 |
7 tasks
6543
pushed a commit
to 6543-forks/gitea
that referenced
this pull request
Feb 26, 2024
- 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:branchnameevery time).Since it was possible to determine if the repository is a fork from within the template, I've added a check in the
hometemplate. I'm not aware of any side effects of this solution.