(timeout any, timeoutSeconds any, defaultSeconds float64)
| 1590 | return "" |
| 1591 | } |
| 1592 | diff, err := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ |
| 1593 | A: difflib.SplitLines(oldContent), |
| 1594 | B: difflib.SplitLines(newContent), |
| 1595 | FromFile: "a/" + path, |
| 1596 | ToFile: "b/" + path, |
| 1597 | Context: contextLines, |
| 1598 | }) |
| 1599 | if err != nil { |
| 1600 | return "" |
| 1601 | } |
| 1602 | diff = strings.TrimRight(diff, "\n") |
| 1603 | if diff == "" { |
| 1604 | return "" |
| 1605 | } |
| 1606 | lines := strings.Split(diff, "\n") |
| 1607 | if len(lines) > 34 { |
| 1608 | lines = append(lines[:34], " ... (diff truncated)") |
| 1609 | } |
| 1610 | return strings.Join(lines, "\n") |
| 1611 | } |
| 1612 | |
| 1613 | func ComputeEditDiffStat(oldContent, newContent string) (int, int) { |
no test coverage detected