From 1207bda94b8de9f0cc618c4ccce235d809a5559e Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Wed, 4 Jan 2017 19:50:34 -0500 Subject: Fix typos in models/ (#576) --- models/git_diff.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'models/git_diff.go') diff --git a/models/git_diff.go b/models/git_diff.go index f796f286d6..eb88d210d4 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -78,7 +78,7 @@ var ( func diffToHTML(diffs []diffmatchpatch.Diff, lineType DiffLineType) template.HTML { buf := bytes.NewBuffer(nil) - // Reproduce signs which are cutted for inline diff before. + // Reproduce signs which are cut for inline diff before. switch lineType { case DiffLineAdd: buf.WriteByte('+') @@ -234,7 +234,7 @@ const cmdDiffHead = "diff --git " // ParsePatch builds a Diff object from a io.Reader and some // parameters. // TODO: move this function to gogits/git-module -func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*Diff, error) { +func ParsePatch(maxLines, maxLineCharacters, maxFiles int, reader io.Reader) (*Diff, error) { var ( diff = &Diff{Files: make([]*DiffFile, 0)} @@ -295,8 +295,8 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (* curFileLinesCount++ lineCount++ - // Diff data too large, we only show the first about maxlines lines - if curFileLinesCount >= maxLines || len(line) >= maxLineCharacteres { + // Diff data too large, we only show the first about maxLines lines + if curFileLinesCount >= maxLines || len(line) >= maxLineCharacters { curFile.IsIncomplete = true } @@ -447,7 +447,7 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (* // GetDiffRange builds a Diff between two commits of a repository. // passing the empty string as beforeCommitID returns a diff from the // parent commit. -func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) { +func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxLineCharacters, maxFiles int) (*Diff, error) { gitRepo, err := git.OpenRepository(repoPath) if err != nil { return nil, err @@ -486,7 +486,7 @@ func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxL pid := process.Add(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath), cmd) defer process.Remove(pid) - diff, err := ParsePatch(maxLines, maxLineCharacteres, maxFiles, stdout) + diff, err := ParsePatch(maxLines, maxLineCharacters, maxFiles, stdout) if err != nil { return nil, fmt.Errorf("ParsePatch: %v", err) } @@ -554,6 +554,6 @@ func GetRawDiff(repoPath, commitID string, diffType RawDiffType, writer io.Write } // GetDiffCommit builds a Diff representing the given commitID. -func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) { - return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacteres, maxFiles) +func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacters, maxFiles int) (*Diff, error) { + return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacters, maxFiles) } -- cgit v1.2.3