From 31d03a11461fabec35397a87266e427ac030adcb Mon Sep 17 00:00:00 2001 From: Manuel Jeckelmann Date: Tue, 28 Jul 2020 14:55:33 +0200 Subject: [PATCH] Clean up 'uncommitted' diff. (#416) --- scan/scan.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scan/scan.go b/scan/scan.go index 668cd03c..39b5f62e 100644 --- a/scan/scan.go +++ b/scan/scan.go @@ -281,7 +281,8 @@ func (repo *Repo) scanUncommitted() error { } } - diffs := diffmatchpatch.New().DiffMain(prevFileContents, currFileContents, false) + dmp := diffmatchpatch.New() + diffs := dmp.DiffCleanupSemantic(dmp.DiffMain(prevFileContents, currFileContents, false)) var diffContents string for _, d := range diffs { if d.Type == diffmatchpatch.DiffInsert {