libgit2/libgit2sharp — Issue #116: LibGit2Sharp appends new lines to commit messages.
Author: Haacked
Created: 2012-02-28 17:37:56+00:00
State: open

LibGit2Sharp (in a recent update) appears to have started adding \n to commit messages.

__Repro Steps__

1. Create a git repository in a directory.
2. Add a file to the directory with some text.
3. Add the file to the index
4. `git commit -m "Initial commit"

Now run the following unit test (this is written with xUnit, but should be easy to port)

[Fact]
public void BugDemo()
{
var repo = new LibGit2Sharp.Repository(@"C:\PATH-TO-YOUR-REPO");
var commit = repo.Commits.First();
Assert.Equal("Initial commit", commit.Message);
}

This test fails because `commit.Message` has a trailing `\n`.