[PR #2163] [MERGED] Make compare button URL aware if current repo is a fork (#2162) #16267

Closed
opened 2025-11-02 12:06:19 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2163
Author: @Weyzu
Created: 7/13/2017
Status: Merged
Merged: 7/15/2017
Merged by: @lunny

Base: masterHead: fix-creation-of-non-fork-pull-requests-within-owners-repo


📝 Commits (4)

  • 34f86e9 Make compare button URL aware if current repo is a fork (#2162)
  • 898023e Optimize code
  • 20ad3a3 To not change current behaviour check if signed in user has fork of base repository
  • 31039b2 Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 templates/repo/home.tmpl (+1 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2163 **Author:** [@Weyzu](https://github.com/Weyzu) **Created:** 7/13/2017 **Status:** ✅ Merged **Merged:** 7/15/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix-creation-of-non-fork-pull-requests-within-owners-repo` --- ### 📝 Commits (4) - [`34f86e9`](https://github.com/go-gitea/gitea/commit/34f86e9b87a2806728a2b5ac641cc3b0f5deef01) Make compare button URL aware if current repo is a fork (#2162) - [`898023e`](https://github.com/go-gitea/gitea/commit/898023e96714edfa621f7ca59edd4b93983b139b) Optimize code - [`20ad3a3`](https://github.com/go-gitea/gitea/commit/20ad3a3c1224357cac4df7d26cbe5bdc1ef872de) To not change current behaviour check if signed in user has fork of base repository - [`31039b2`](https://github.com/go-gitea/gitea/commit/31039b2d95a277dcd7cbc9e156cb9b8cd66f6bf2) Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `templates/repo/home.tmpl` (+1 -1) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:06:19 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16267