|
78 | 78 | func diffToHTML(diffs []diffmatchpatch.Diff, lineType DiffLineType) template.HTML {
|
79 | 79 | buf := bytes.NewBuffer(nil)
|
80 | 80 |
|
81 |
| - // Reproduce signs which are cutted for inline diff before. |
| 81 | + // Reproduce signs which are cut for inline diff before. |
82 | 82 | switch lineType {
|
83 | 83 | case DiffLineAdd:
|
84 | 84 | buf.WriteByte('+')
|
@@ -234,7 +234,7 @@ const cmdDiffHead = "diff --git "
|
234 | 234 | // ParsePatch builds a Diff object from a io.Reader and some
|
235 | 235 | // parameters.
|
236 | 236 | // TODO: move this function to gogits/git-module
|
237 |
| -func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*Diff, error) { |
| 237 | +func ParsePatch(maxLines, maxLineCharacters, maxFiles int, reader io.Reader) (*Diff, error) { |
238 | 238 | var (
|
239 | 239 | diff = &Diff{Files: make([]*DiffFile, 0)}
|
240 | 240 |
|
@@ -295,8 +295,8 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*
|
295 | 295 | curFileLinesCount++
|
296 | 296 | lineCount++
|
297 | 297 |
|
298 |
| - // Diff data too large, we only show the first about maxlines lines |
299 |
| - if curFileLinesCount >= maxLines || len(line) >= maxLineCharacteres { |
| 298 | + // Diff data too large, we only show the first about maxLines lines |
| 299 | + if curFileLinesCount >= maxLines || len(line) >= maxLineCharacters { |
300 | 300 | curFile.IsIncomplete = true
|
301 | 301 | }
|
302 | 302 |
|
@@ -447,7 +447,7 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*
|
447 | 447 | // GetDiffRange builds a Diff between two commits of a repository.
|
448 | 448 | // passing the empty string as beforeCommitID returns a diff from the
|
449 | 449 | // parent commit.
|
450 |
| -func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) { |
| 450 | +func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxLineCharacters, maxFiles int) (*Diff, error) { |
451 | 451 | gitRepo, err := git.OpenRepository(repoPath)
|
452 | 452 | if err != nil {
|
453 | 453 | return nil, err
|
@@ -486,7 +486,7 @@ func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxL
|
486 | 486 | pid := process.Add(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath), cmd)
|
487 | 487 | defer process.Remove(pid)
|
488 | 488 |
|
489 |
| - diff, err := ParsePatch(maxLines, maxLineCharacteres, maxFiles, stdout) |
| 489 | + diff, err := ParsePatch(maxLines, maxLineCharacters, maxFiles, stdout) |
490 | 490 | if err != nil {
|
491 | 491 | return nil, fmt.Errorf("ParsePatch: %v", err)
|
492 | 492 | }
|
@@ -554,6 +554,6 @@ func GetRawDiff(repoPath, commitID string, diffType RawDiffType, writer io.Write
|
554 | 554 | }
|
555 | 555 |
|
556 | 556 | // GetDiffCommit builds a Diff representing the given commitID.
|
557 |
| -func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) { |
558 |
| - return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacteres, maxFiles) |
| 557 | +func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacters, maxFiles int) (*Diff, error) { |
| 558 | + return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacters, maxFiles) |
559 | 559 | }
|
0 commit comments