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

Make compare button URL aware if current repo is a fork (#2162) #2163

Merged
merged 4 commits into from
Jul 15, 2017
Merged

Make compare button URL aware if current repo is a fork (#2162) #2163

merged 4 commits into from
Jul 15, 2017

Conversation

Weyzu
Copy link
Contributor

@Weyzu Weyzu commented Jul 13, 2017

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.

@lunny lunny added the type/bug label Jul 14, 2017
@lunny lunny added this to the 1.3.0 milestone Jul 14, 2017
@lafriks
Copy link
Member

lafriks commented Jul 14, 2017

Thanks for PR, I hope you don't mind that did a small code optimization. Tested and works just fine, so LGTM

@tboerger tboerger added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 14, 2017
@Weyzu
Copy link
Contributor Author

Weyzu commented Jul 14, 2017

Not at all. :) Thanks for the quick response. ✌️

@lafriks
Copy link
Member

lafriks commented Jul 14, 2017

@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?

@sapk
Copy link
Member

sapk commented Jul 14, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 14, 2017
@lafriks
Copy link
Member

lafriks commented Jul 14, 2017

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

@lafriks lafriks modified the milestones: 1.2.0, 1.3.0 Jul 14, 2017
@lunny lunny merged commit 32f289a into go-gitea:master Jul 15, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants