summaryrefslogtreecommitdiffstats
path: root/models/git_diff.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-01-04 19:50:34 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-05 08:50:34 +0800
commit1207bda94b8de9f0cc618c4ccce235d809a5559e (patch)
tree9650961a7aa1dd3de883f5f6bef27db420b26227 /models/git_diff.go
parentdc3ff9f2abc935f06940de56d613dacde3ee8c13 (diff)
downloadgitea-1207bda94b8de9f0cc618c4ccce235d809a5559e.tar.gz
gitea-1207bda94b8de9f0cc618c4ccce235d809a5559e.zip
Fix typos in models/ (#576)
Diffstat (limited to 'models/git_diff.go')
-rw-r--r--models/git_diff.go16
1 files changed, 8 insertions, 8 deletions
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)
}