Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

knotserver/git/merge: pre-compile conflict error regex at package init

Signed-off-by: Matías Insaurralde <matias@insaurral.de>

authored by

Matías Insaurralde and committed by tangled.org 2677d2b1 5a17af77

+3 -2
+3 -2
knotserver/git/merge.go
··· 22 22 } 23 23 24 24 var ( 25 - mergeCheckCache MergeCheckCache 25 + mergeCheckCache MergeCheckCache 26 + conflictErrorRegex = regexp.MustCompile(`^error: (.*):(\d+): (.*)$`) 26 27 ) 27 28 28 29 func init() { ··· 409 408 continue 410 409 } 411 410 412 - if match := regexp.MustCompile(`^error: (.*):(\d+): (.*)$`).FindStringSubmatch(line); len(match) >= 4 { 411 + if match := conflictErrorRegex.FindStringSubmatch(line); len(match) >= 4 { 413 412 if currentFile == "" { 414 413 currentFile = match[1] 415 414 }