Add golangci (#6418)
This commit is contained in:
parent
5832f8d90d
commit
f9ec2f89f2
147 changed files with 1046 additions and 774 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue