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

GitCommit.raw_log only drop last msg line if blank #42

Merged
merged 3 commits into from Apr 16, 2015

Conversation

Projects
None yet
2 participants
@scottnonnenberg
Contributor

scottnonnenberg commented Apr 15, 2015

Fixes the message-dropping behavior I saw, potentially the same thing as #38.

@jankeromnes

This comment has been minimized.

Collaborator

jankeromnes commented Apr 16, 2015

Hi @scottnonnenberg, thanks a lot for fixing this! Do you think we could also add a test that ensures one-line commit messages aren't being dropped in the future?

length -= 1;
}
for(var i = 0; i < length; i++) {
output = output + ' ' + lines[i] + '\n';

This comment has been minimized.

@jankeromnes

jankeromnes Apr 16, 2015

Collaborator

Nit: Please use output += here.

// drop last line if it's blank
if (length > 0 && lines[length - 1].length === 0) {
length -= 1;

This comment has been minimized.

@jankeromnes

jankeromnes Apr 16, 2015

Collaborator

Nit: Please use length-- here.

@scottnonnenberg

This comment has been minimized.

Contributor

scottnonnenberg commented Apr 16, 2015

Unit tests added. Seems that the couple full repos under /test all have the expected trailing newline, so I couldn't use any existing fixture data.

@jankeromnes

This comment has been minimized.

Collaborator

jankeromnes commented Apr 16, 2015

Awesome, thanks!

@jankeromnes jankeromnes merged commit c88e44a into christkv:master Apr 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment