mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-17 02:14:53 +08:00
Enable addtional linters (#34085)
enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -6,6 +6,7 @@ package files
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@ -414,7 +415,7 @@ func (t *TemporaryUploadRepository) DiffIndex(ctx context.Context) (*gitdiff.Dif
|
||||
// GetBranchCommit Gets the commit object of the given branch
|
||||
func (t *TemporaryUploadRepository) GetBranchCommit(branch string) (*git.Commit, error) {
|
||||
if t.gitRepo == nil {
|
||||
return nil, fmt.Errorf("repository has not been cloned")
|
||||
return nil, errors.New("repository has not been cloned")
|
||||
}
|
||||
return t.gitRepo.GetBranchCommit(branch)
|
||||
}
|
||||
@ -422,7 +423,7 @@ func (t *TemporaryUploadRepository) GetBranchCommit(branch string) (*git.Commit,
|
||||
// GetCommit Gets the commit object of the given commit ID
|
||||
func (t *TemporaryUploadRepository) GetCommit(commitID string) (*git.Commit, error) {
|
||||
if t.gitRepo == nil {
|
||||
return nil, fmt.Errorf("repository has not been cloned")
|
||||
return nil, errors.New("repository has not been cloned")
|
||||
}
|
||||
return t.gitRepo.GetCommit(commitID)
|
||||
}
|
||||
|
Reference in New Issue
Block a user