Skip to content
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

Handle incomplete diff files properly #13662

Merged

Conversation

zeripath
Copy link
Contributor

The code for parsing diff hunks has a bug whereby a very long line
in a very long diff would not be completely read leading to an unexpected
character.

This PR ensures that the line is completely cleared

Fix #13602

Signed-off-by: Andrew Thornton art27@cantab.net

The code for parsing diff hunks has a bug whereby a very long line
in a very long diff would not be completely read leading to an unexpected
character.

This PR ensures that the line is completely cleared

Fix go-gitea#13602

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.14.0 milestone Nov 21, 2020
@codecov-io
Copy link

codecov-io commented Nov 21, 2020

Codecov Report

Merging #13662 (8d289d7) into master (c5f6f8f) will decrease coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13662      +/-   ##
==========================================
- Coverage   42.23%   42.22%   -0.01%     
==========================================
  Files         697      697              
  Lines       76576    76585       +9     
==========================================
  Hits        32340    32340              
- Misses      38919    38929      +10     
+ Partials     5317     5316       -1     
Impacted Files Coverage Δ
services/gitdiff/gitdiff.go 69.05% <66.66%> (+1.33%) ⬆️
services/pull/temp_repo.go 26.59% <0.00%> (-3.20%) ⬇️
services/pull/check.go 48.90% <0.00%> (-2.92%) ⬇️
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
services/pull/patch.go 53.97% <0.00%> (-1.71%) ⬇️
routers/repo/view.go 37.47% <0.00%> (-0.65%) ⬇️
modules/queue/unique_queue_disk_channel.go 55.38% <0.00%> (+1.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5f6f8f...8d289d7. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 21, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
@GiteaBot GiteaBot 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 Nov 21, 2020
@GiteaBot GiteaBot 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 Nov 21, 2020
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified

@6543 6543 added the backport/done All backports for this PR have been created label Nov 21, 2020
@6543
Copy link
Member

6543 commented Nov 21, 2020

@techknowlogick
Copy link
Member

🚀

@techknowlogick techknowlogick merged commit 45ca2e4 into go-gitea:master Nov 21, 2020
@zeripath zeripath deleted the fix-13602-incomplete-line-length branch November 22, 2020 16:51
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created 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.

Error creating pull requests or diffs with very long diffs containing very long lines
7 participants