Skip to content

Commit 94916db

Browse files
committed
fix lint and ui
Signed-off-by: a1012112796 <1012112796@qq.com>
1 parent 2bab049 commit 94916db

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

routers/web/repo/compare.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package repo
55

66
import (
77
"bufio"
8-
gocontext "context"
98
"encoding/csv"
109
"errors"
1110
"fmt"
@@ -730,30 +729,6 @@ func PrepareCompareDiff(
730729
return false
731730
}
732731

733-
func getBranchesAndTagsForRepo(ctx gocontext.Context, repo *repo_model.Repository) (branches, tags []string, err error) {
734-
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
735-
if err != nil {
736-
return nil, nil, err
737-
}
738-
defer gitRepo.Close()
739-
740-
branches, err = git_model.FindBranchNames(ctx, git_model.FindBranchOptions{
741-
RepoID: repo.ID,
742-
ListOptions: db.ListOptions{
743-
ListAll: true,
744-
},
745-
IsDeletedBranch: optional.Some(false),
746-
})
747-
if err != nil {
748-
return nil, nil, err
749-
}
750-
tags, err = gitRepo.GetTags(0, 0)
751-
if err != nil {
752-
return nil, nil, err
753-
}
754-
return branches, tags, nil
755-
}
756-
757732
func prepareHeadBranchAndTags(ctx *context.Context, headRepoID int64) {
758733
headBranches, err := git_model.FindBranchNames(ctx, git_model.FindBranchOptions{
759734
RepoID: headRepoID,

templates/repo/diff/compare.tmpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@
7272
</div>
7373
</div>
7474

75-
<div class="ui floating compare-switch-btn">
76-
{{svg "octicon-arrow-left"}}
77-
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUserName}}/{{PathEscape $.HeadRepoName}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a>
78-
</div>
75+
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUserName}}/{{PathEscape $.HeadRepoName}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{svg "octicon-arrow-left" 16}}<div class="compare-separator">{{.CompareSeparator}}</div></a>
7976

8077
<div class="ui floating filter dropdown repo-search-box">
8178
<div class="ui basic small button">

0 commit comments

Comments
 (0)