[PR #1927] [MERGED] Fix errors caused by force push #16125

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

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1927
Author: @ethantkoenig
Created: 6/10/2017
Status: Merged
Merged: 6/11/2017
Merged by: @appleboy

Base: masterHead: fix/force_push


📝 Commits (1)

  • 2178fcc Fix errors caused by force push

📊 Changes

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

View changed files

📝 models/repo.go (+7 -6)

📄 Description

Fixes #1157

Do git fetch origin, followed by git reset --hard origin/<branch> in UpdateLocalCopyBranch(..) instead of a pull. This accounts for the case where others have made force pushes to origin, and the local repository maintained by gitea contains commits that are no longer in origin.

/cc @geek1011


🔄 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/1927 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 6/10/2017 **Status:** ✅ Merged **Merged:** 6/11/2017 **Merged by:** [@appleboy](https://github.com/appleboy) **Base:** `master` ← **Head:** `fix/force_push` --- ### 📝 Commits (1) - [`2178fcc`](https://github.com/go-gitea/gitea/commit/2178fcc3878ee3541d6390ec7006a706cc16e64a) Fix errors caused by force push ### 📊 Changes **1 file changed** (+7 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `models/repo.go` (+7 -6) </details> ### 📄 Description Fixes #1157 Do `git fetch origin`, followed by `git reset --hard origin/<branch>` in `UpdateLocalCopyBranch(..)` instead of a pull. This accounts for the case where others have made force pushes to origin, and the local repository maintained by gitea contains commits that are no longer in origin. /cc @geek1011 --- <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:02:53 -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#16125