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

Make sure path is not incorrectly modified via ref #8

Merged
merged 1 commit into from
Dec 20, 2016
Merged

Make sure path is not incorrectly modified via ref #8

merged 1 commit into from
Dec 20, 2016

Conversation

kibra
Copy link
Contributor

@kibra kibra commented Dec 13, 2016

Sometimes, the path name would be incorrectly listed as the last path processed. This makes sure the path is not updated via the path pointer.

@coveralls
Copy link

coveralls commented Dec 13, 2016

Coverage Status

Coverage increased (+0.07%) to 92.793% when pulling 1afa7d4 on kibra:fix_path_name_munging into 7b70699 on d4l3k:master.

Copy link
Owner

@d4l3k d4l3k left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

Could you also fix the failing test? Looks like we're testing for the incorrect behavior.

https://github.com/d4l3k/messagediff/blob/master/example/atom_test.go#L16

https://travis-ci.org/d4l3k/messagediff/jobs/183451007#L189

d.Modified[&path] = bVal.Interface()
localPath := make(Path, len(path))
copy(localPath, path)
d.Modified[&localPath] = bVal.Interface()
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of just copying in that one specific location, would be good to move it to the top of the diff function. That way it fixes all cases of that.

localPath := make(Path, len(path))
copy(localPath, path)
path = localPath

Near https://github.com/d4l3k/messagediff/pull/8/files#diff-2aea0ca6be2f84668b7aefadf8f8ac26R44.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup makes sense. Will fixup.

@coveralls
Copy link

coveralls commented Dec 15, 2016

Coverage Status

Coverage increased (+0.2%) to 91.556% when pulling b6527c0 on kibra:fix_path_name_munging into e5fe178 on d4l3k:master.

@kibra
Copy link
Contributor Author

kibra commented Dec 15, 2016

Tests updated and feedback addressed :)

@d4l3k d4l3k merged commit 2fe2a1d into d4l3k:master Dec 20, 2016
@d4l3k
Copy link
Owner

d4l3k commented Dec 20, 2016

Thanks for fixing that!

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.

None yet

3 participants