[PR #1425] [MERGED] fixes pull request hanging when it contains normal and LFS files #15901

Closed
opened 2025-11-02 11:57:18 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1425
Author: @kubatyszko
Created: 3/31/2017
Status: Merged
Merged: 4/3/2017
Merged by: @appleboy

Base: masterHead: bugfix/lfspointers_pullreqs


📝 Commits (1)

  • 6341db2 fixes pull request hanging indefinitely when it contains normal and LFS file pointers

📊 Changes

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

View changed files

📝 models/git_diff.go (+0 -1)

📄 Description

…FS file pointers

I found an issue where branch that has a mix of ordinary and LFS-backed files, this basically means that the diff (returned by command "git diff -M old_branch new_branch") never finishes.

There's a branch in the ParsePatch function that checks if the file currently patched is an LFS backed one, and then it breaks out of the loop - this somehow causes the bufio.NewReader(reader) to never finish...

To reproduce:

  • create a repo
  • put some files into it
  • create a branch
  • make some changes, and ensure some of the changes include putting new LFS objects and ideally changing a non-lfs to an LFS file. - basically you need to ensure that the 'git diff' between the branch and master has the 'oid: ' section of an LFS file pointer.
  • create a new PR, select the branch - it should hang, you will also see a 'git diff -M old new'

🔄 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/1425 **Author:** [@kubatyszko](https://github.com/kubatyszko) **Created:** 3/31/2017 **Status:** ✅ Merged **Merged:** 4/3/2017 **Merged by:** [@appleboy](https://github.com/appleboy) **Base:** `master` ← **Head:** `bugfix/lfspointers_pullreqs` --- ### 📝 Commits (1) - [`6341db2`](https://github.com/go-gitea/gitea/commit/6341db2180fccc521a9d162f2ffdcd89de7df881) fixes pull request hanging indefinitely when it contains normal and LFS file pointers ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `models/git_diff.go` (+0 -1) </details> ### 📄 Description …FS file pointers I found an issue where branch that has a mix of ordinary and LFS-backed files, this basically means that the diff (returned by command "git diff -M old_branch new_branch") never finishes. There's a branch in the ParsePatch function that checks if the file currently patched is an LFS backed one, and then it breaks out of the loop - this somehow causes the bufio.NewReader(reader) to never finish... To reproduce: * create a repo * put some files into it * create a branch * make some changes, and ensure some of the changes include putting new LFS objects and ideally changing a non-lfs to an LFS file. - basically you need to ensure that the 'git diff' between the branch and master has the 'oid: ' section of an LFS file pointer. * create a new PR, select the branch - it should hang, you will also see a 'git diff -M old new' --- <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:57:18 -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#15901