Skip to content

fixes pull request hanging when it contains normal and LFS files #1425

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

Merged
merged 1 commit into from
Apr 3, 2017
Merged

fixes pull request hanging when it contains normal and LFS files #1425

merged 1 commit into from
Apr 3, 2017

Conversation

kubatyszko
Copy link
Contributor

@kubatyszko kubatyszko commented Mar 31, 2017

…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'

@kubatyszko kubatyszko changed the title fixes pull request hanging indefinitely when it contains normal and L… fixes pull request hanging when it contains normal and LFS files Mar 31, 2017
@kubatyszko
Copy link
Contributor Author

@fabian-z - you might want to verify this and confirm.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 31, 2017
@kubatyszko
Copy link
Contributor Author

I have verified that change on my enterprise installation, the main culprit (large PR) went through very smoothly after this.

@lunny lunny added this to the 1.2.0 milestone Apr 1, 2017
@lunny lunny added the type/bug label Apr 1, 2017
@pgaskin
Copy link
Contributor

pgaskin commented Apr 2, 2017

LGTM

@tboerger tboerger added 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 Apr 2, 2017
@strk
Copy link
Member

strk commented Apr 2, 2017

@kubatyszko it would help to have an automated testcase to show the problem and guard after the fix, anyway it 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 Apr 2, 2017
@appleboy appleboy merged commit 5d6b71f into go-gitea:master Apr 3, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
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.

6 participants