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

Fixed panic on diffparser when first line is invalid #29

Closed

Conversation

mazen160
Copy link

There is a panic that is not caught on the latest release of diffparser that is not caught by error handling.

I have introduced in my tool, and thought to share the fix with everyone, and hopefully to have it merged soon.

How to produce the panic?

The diff_raw is missing diff --git a/file.txt b/file.txt

	var diff_raw string = `
new file mode 100644
index 0000000..814b5ab
--- /dev/null
+++ b/file.txt
@@ -0,0 +1,4 @@
+Hello world`

diff, err := diffparser.Parse(diff_raw)
if err != nill {
  error.Wrapf("handled successfully", err)
}

Best Regards,
Mazin

@mazen160 mazen160 closed this Jun 6, 2024
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.

1 participant