summaryrefslogtreecommitdiffstats
path: root/modules/git/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/commit.go')
-rw-r--r--modules/git/commit.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/git/commit.go b/modules/git/commit.go
index 7b64a300ab..c86ece9848 100644
--- a/modules/git/commit.go
+++ b/modules/git/commit.go
@@ -133,7 +133,7 @@ func (c *Commit) ParentCount() int {
func isImageFile(data []byte) (string, bool) {
contentType := http.DetectContentType(data)
- if strings.Index(contentType, "image/") != -1 {
+ if strings.Contains(contentType, "image/") {
return contentType, true
}
return contentType, false
@@ -206,8 +206,7 @@ func CommitChanges(repoPath string, opts CommitChangesOptions) error {
}
func commitsCount(repoPath, revision, relpath string) (int64, error) {
- var cmd *Command
- cmd = NewCommand("rev-list", "--count")
+ cmd := NewCommand("rev-list", "--count")
cmd.AddArguments(revision)
if len(relpath) > 0 {
cmd.AddArguments("--", relpath)
@@ -263,7 +262,7 @@ type SearchCommitsOptions struct {
All bool
}
-// NewSearchCommitsOptions contruct a SearchCommitsOption from a space-delimited search string
+// NewSearchCommitsOptions construct a SearchCommitsOption from a space-delimited search string
func NewSearchCommitsOptions(searchString string, forAllRefs bool) SearchCommitsOptions {
var keywords, authors, committers []string
var after, before string