mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-16 04:54:05 +00:00
fix lint and typos
This commit is contained in:
parent
d784a0f25d
commit
c80f0b9d46
@ -74,7 +74,7 @@ func (repo *Repository) GetTreePathLatestCommit(refName, treePath string) (*Comm
|
|||||||
return repo.GetCommit(strings.TrimSpace(stdout))
|
return repo.GetCommit(strings.TrimSpace(stdout))
|
||||||
}
|
}
|
||||||
|
|
||||||
// rev-parse parses the output of `git rev-parse` command
|
// RevParse resolves a revision reference to other git-related objects
|
||||||
func (repo *Repository) RevParse(ref, file string) (string, error) {
|
func (repo *Repository) RevParse(ref, file string) (string, error) {
|
||||||
stdout, _, err := NewCommand("rev-parse").
|
stdout, _, err := NewCommand("rev-parse").
|
||||||
AddDynamicArguments(ref+":"+file).
|
AddDynamicArguments(ref+":"+file).
|
||||||
|
@ -234,7 +234,7 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
|
|||||||
if infoPath == "" {
|
if infoPath == "" {
|
||||||
infos = []string{baseRepo.DefaultBranch, baseRepo.DefaultBranch}
|
infos = []string{baseRepo.DefaultBranch, baseRepo.DefaultBranch}
|
||||||
} else {
|
} else {
|
||||||
// check if head is a branch or tag on ly infoPath ends with .diff or .patch
|
// check if head is a branch or tag only if infoPath ends with .diff or .patch
|
||||||
if strings.HasSuffix(infoPath, ".diff") || strings.HasSuffix(infoPath, ".patch") {
|
if strings.HasSuffix(infoPath, ".diff") || strings.HasSuffix(infoPath, ".patch") {
|
||||||
infos = strings.SplitN(infoPath, "...", 2)
|
infos = strings.SplitN(infoPath, "...", 2)
|
||||||
if len(infos) != 2 {
|
if len(infos) != 2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user