summaryrefslogtreecommitdiff
path: root/src/diff_driver.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-01-27 11:45:06 -0800
committerRussell Belfer <rb@github.com>2014-01-27 11:45:06 -0800
commit082e82dba5b5174756b3a5fc2e385ccc59626164 (patch)
tree9191ea9e222c54163c275e1179600b02ebe264b2 /src/diff_driver.c
parent4115987739fb9cc4dd82edd9998db6dbb6bc9d95 (diff)
downloadlibgit2-082e82dba5b5174756b3a5fc2e385ccc59626164.tar.gz
Update Javascript userdiff driver and tests
Writing a sample Javascript driver pointed out some extra whitespace handling that needed to be done in the diff driver. This adds some tests with some sample javascript code that I pulled off of GitHub just to see what would happen. Also, to clean up the userdiff test data, I did a "git gc" and packed up the test objects.
Diffstat (limited to 'src/diff_driver.c')
-rw-r--r--src/diff_driver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 9249d1415..4c9a0af65 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -437,6 +437,7 @@ static int diff_context_line__pattern_match(
i = (pmatch[1].rm_so >= 0) ? 1 : 0;
git_buf_consume(line, git_buf_cstr(line) + pmatch[i].rm_so);
git_buf_truncate(line, pmatch[i].rm_eo - pmatch[i].rm_so);
+ git_buf_rtrim(line);
return true;
}