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

Remove extra leading space on neutral lines (fixes #16) #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

detouched
Copy link

This removes an extra leading character in a safe manner.

// Neutral line should have a space as its first character,
// however not all tools seem to obey this rule for empty lines (see Tortoise diff),
// so let's strip the first character if present.
String content = currentLine.substring(Math.min(1, currentLine.length()));
Copy link
Author

Choose a reason for hiding this comment

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

I don't use TortoiseSVN and can't test whether it actually strips out the line type symbol in case the actual line is empty, but making this .substring() call in a safe manner doesn't hurt anyway.

Copy link
Author

@detouched detouched Jun 7, 2018

Choose a reason for hiding this comment

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

Actually it looks like there's an issue #9 about TortoiseSVN example specifically. Maybe the example is incorrect?

package io.reflectoring.diffparser.unified;

import io.reflectoring.diffparser.api.model.Line;
import junit.framework.Assert;
Copy link
Author

Choose a reason for hiding this comment

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

Later I noticed that there's a mess with TestNG vs Junit dependencies, which I fixed in my other PR.

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