From 3dc0d500ef5d983e4b132cb4b44b2780855dbfa5 Mon Sep 17 00:00:00 2001 From: Vadim Markovtsev Date: Sun, 10 Mar 2019 08:50:40 +0100 Subject: Increase diffmatchcpatch timeout Fixes https://github.com/src-d/go-git/issues/1083 Signed-off-by: Vadim Markovtsev --- utils/diff/diff.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'utils') diff --git a/utils/diff/diff.go b/utils/diff/diff.go index f49ae55..8539230 100644 --- a/utils/diff/diff.go +++ b/utils/diff/diff.go @@ -8,6 +8,7 @@ package diff import ( "bytes" + "time" "github.com/sergi/go-diff/diffmatchpatch" ) @@ -16,6 +17,7 @@ import ( // string into the dst string. func Do(src, dst string) (diffs []diffmatchpatch.Diff) { dmp := diffmatchpatch.New() + dmp.DiffTimeout = time.Hour // the default is time.Second which may be too little under heavy load wSrc, wDst, warray := dmp.DiffLinesToRunes(src, dst) diffs = dmp.DiffMainRunes(wSrc, wDst, false) diffs = dmp.DiffCharsToLines(diffs, warray) -- cgit