[PR #276] [MERGED] Speed up conflict checking in pull request creation #15281

Closed
opened 2025-11-02 11:43:03 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/276
Author: @typeless
Created: 11/27/2016
Status: Merged
Merged: 12/29/2016
Merged by: @lunny

Base: masterHead: speedup-patch-test


📝 Commits (3)

  • c39e0b3 Speed up conflict checking in pull request creation
  • f349204 Use $GIT_INDEX_FILE instead of --index-output to avoid lockfile problem
  • f635203 Temporary file names should not prefixed with '-'

📊 Changes

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

View changed files

📝 models/pull.go (+15 -8)

📄 Description

In order to check conflicts of a PR, we set up a working tree by cloning the base branch, which is quite time-consuming and would hang the web response when the repository is huge.
Instead, this PR uses git read-tree and git apply --check --cached to check conflicts, where only the index file is required to be created.

For #258


🔄 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/276 **Author:** [@typeless](https://github.com/typeless) **Created:** 11/27/2016 **Status:** ✅ Merged **Merged:** 12/29/2016 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `speedup-patch-test` --- ### 📝 Commits (3) - [`c39e0b3`](https://github.com/go-gitea/gitea/commit/c39e0b3cbaef4d87c6d63a71c2090d8873491ea7) Speed up conflict checking in pull request creation - [`f349204`](https://github.com/go-gitea/gitea/commit/f349204ea98cf5d8135d75ae361f4d4e8c29d737) Use $GIT_INDEX_FILE instead of --index-output to avoid lockfile problem - [`f635203`](https://github.com/go-gitea/gitea/commit/f635203d9f02e173c8f8162181af40d1aab5b2e7) Temporary file names should not prefixed with '-' ### 📊 Changes **1 file changed** (+15 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `models/pull.go` (+15 -8) </details> ### 📄 Description In order to check conflicts of a PR, we set up a working tree by cloning the base branch, which is quite time-consuming and would hang the web response when the repository is huge. Instead, this PR uses `git read-tree` and `git apply --check --cached` to check conflicts, where only the index file is required to be created. For #258 --- <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 11:43:03 -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#15281