fix lint and typos

This commit is contained in:
badhezi 2025-05-14 15:18:18 +03:00
parent d784a0f25d
commit c80f0b9d46
3 changed files with 3 additions and 3 deletions

View File

@ -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).

View 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 {