aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorVadim Markovtsev <vadim@sourced.tech>2019-03-10 08:50:40 +0100
committerVadim Markovtsev <vadim@sourced.tech>2019-03-10 08:50:40 +0100
commit3dc0d500ef5d983e4b132cb4b44b2780855dbfa5 (patch)
treede885769e7cd5ca1c37d3f953266cd1358cdfb71 /utils
parent25e9f61108d7097d6614872b4d65e15f4cb581fa (diff)
downloadgo-git-3dc0d500ef5d983e4b132cb4b44b2780855dbfa5.tar.gz
Increase diffmatchcpatch timeout
Fixes https://github.com/src-d/go-git/issues/1083 Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Diffstat (limited to 'utils')
-rw-r--r--utils/diff/diff.go2
1 files changed, 2 insertions, 0 deletions
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)