Skip to content

Support renamed binary files without index-row #63

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
Jun 25, 2021

Conversation

zegl
Copy link
Contributor

@zegl zegl commented Jun 7, 2021

I found a wild diff generated by libgit2 that was previously unparsable by go-diff. The only difference in this diff (included as testdata) and diffs that are parsable by go-diff is the "index" row, such as "index 17a971d..599f8dd 100644".

This commit adds support for renamed binary files without that index row.

@codecov
Copy link

codecov bot commented Jun 7, 2021

Codecov Report

Merging #63 (c26dd7a) into master (35b24a7) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #63      +/-   ##
==========================================
+ Coverage   77.34%   77.39%   +0.04%     
==========================================
  Files           4        4              
  Lines         490      491       +1     
==========================================
+ Hits          379      380       +1     
  Misses         63       63              
  Partials       48       48              
Impacted Files Coverage Δ
diff/parse.go 84.07% <100.00%> (+0.04%) ⬆️

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 35b24a7...c26dd7a. Read the comment docs.

@keegancsmith keegancsmith requested review from mrnugget and eseliger June 7, 2021 13:20
Copy link
Contributor

@mrnugget mrnugget left a comment

Choose a reason for hiding this comment

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

Thanks! Change looks good to me, although I wonder: under which circumstances is a diff like that produced?

@mrnugget mrnugget merged commit 9d1f353 into sourcegraph:master Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants