mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-23 01:58:03 +08:00
Add golangci (#6418)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user