4
0
Эх сурвалжийг харах

Clean up 'uncommitted' diff. (#416)

Manuel Jeckelmann 5 жил өмнө
parent
commit
31d03a1146
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      scan/scan.go

+ 2 - 1
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 {