mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-04 03:46:53 +02: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))
|
||||
}
|
||||
|
||||
// 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) {
|
||||
stdout, _, err := NewCommand("rev-parse").
|
||||
AddDynamicArguments(ref+":"+file).
|
||||
|
@ -234,7 +234,7 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
|
||||
if infoPath == "" {
|
||||
infos = []string{baseRepo.DefaultBranch, baseRepo.DefaultBranch}
|
||||
} 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") {
|
||||
infos = strings.SplitN(infoPath, "...", 2)
|
||||
if len(infos) != 2 {
|
||||
|
@ -10,7 +10,7 @@
|
||||
{{else if .Commit.ID.String}}
|
||||
<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
|
||||
<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
|
||||
{{else if $.PageIsCompareDiff }}
|
||||
{{else if $.PageIsCompareDiff}}
|
||||
<a class="item" href="{{$.Link}}.patch" download="{{$.BaseBranch}}...{{$.HeadBranch}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
|
||||
<a class="item" href="{{$.Link}}.diff" download="{{$.BaseBranch}}...{{$.HeadBranch}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
|
||||
{{end}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user