Skip to content

Commit 160b20e

Browse files
Merge branch 'go-gitea:main' into main
2 parents 20a916f + de6c718 commit 160b20e

File tree

7 files changed

+29
-3
lines changed

7 files changed

+29
-3
lines changed

models/issues/pull_list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequ
111111
return prs, db.GetEngine(db.DefaultContext).
112112
Where("base_repo_id=? AND base_branch=? AND has_merged=? AND issue.is_closed=?",
113113
repoID, branch, false, false).
114+
OrderBy("issue.updated_unix DESC").
114115
Join("INNER", "issue", "issue.id=pull_request.issue_id").
115116
Find(&prs)
116117
}

modules/markup/sanitizer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ func createDefaultPolicy() *bluemonday.Policy {
132132

133133
policy.AllowAttrs(generalSafeAttrs...).OnElements(generalSafeElements...)
134134

135+
policy.AllowAttrs("src", "autoplay", "controls").OnElements("video")
136+
135137
policy.AllowAttrs("itemscope", "itemtype").OnElements("div")
136138

137139
// FIXME: Need to handle longdesc in img but there is no easy way to do it

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ issues.error_removing_due_date = "Failed to remove the due date."
14711471
issues.push_commit_1 = "added %d commit %s"
14721472
issues.push_commits_n = "added %d commits %s"
14731473
issues.force_push_codes = `force-pushed %[1]s from <a class="ui sha" href="%[3]s"><code>%[2]s</code></a> to <a class="ui sha" href="%[5]s"><code>%[4]s</code></a> %[6]s`
1474+
issues.force_push_compare = Compare
14741475
issues.due_date_form = "yyyy-mm-dd"
14751476
issues.due_date_form_add = "Add due date"
14761477
issues.due_date_form_edit = "Edit"

services/pull/temp_repo.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ func createTemporaryRepo(ctx context.Context, pr *issues_model.PullRequest) (str
6767
remoteRepoName := "head_repo"
6868
baseBranch := "base"
6969

70+
fetchArgs := git.TrustedCmdArgs{"--no-tags"}
71+
if git.CheckGitVersionAtLeast("2.25.0") == nil {
72+
// Writing the commit graph can be slow and is not needed here
73+
fetchArgs = append(fetchArgs, "--no-write-commit-graph")
74+
}
75+
7076
// Add head repo remote.
7177
addCacheRepo := func(staging, cache string) error {
7278
p := filepath.Join(staging, ".git", "objects", "info", "alternates")
@@ -108,7 +114,7 @@ func createTemporaryRepo(ctx context.Context, pr *issues_model.PullRequest) (str
108114
outbuf.Reset()
109115
errbuf.Reset()
110116

111-
if err := git.NewCommand(ctx, "fetch", "origin", "--no-tags").AddDashesAndList(pr.BaseBranch+":"+baseBranch, pr.BaseBranch+":original_"+baseBranch).
117+
if err := git.NewCommand(ctx, "fetch", "origin").AddArguments(fetchArgs...).AddDashesAndList(pr.BaseBranch+":"+baseBranch, pr.BaseBranch+":original_"+baseBranch).
112118
Run(&git.RunOpts{
113119
Dir: tmpBasePath,
114120
Stdout: &outbuf,
@@ -171,7 +177,7 @@ func createTemporaryRepo(ctx context.Context, pr *issues_model.PullRequest) (str
171177
} else {
172178
headBranch = pr.GetGitRefName()
173179
}
174-
if err := git.NewCommand(ctx, "fetch", "--no-tags").AddDynamicArguments(remoteRepoName, headBranch+":"+trackingBranch).
180+
if err := git.NewCommand(ctx, "fetch").AddArguments(fetchArgs...).AddDynamicArguments(remoteRepoName, headBranch+":"+trackingBranch).
175181
Run(&git.RunOpts{
176182
Dir: tmpBasePath,
177183
Stdout: &outbuf,

templates/repo/issue/view_content/comments.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@
707707
{{$.locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}}
708708
{{end}}
709709
</span>
710+
{{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}}
711+
<span class="ui float right comparebox">
712+
<a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{$.locale.Tr "repo.issues.force_push_compare"}}</a>
713+
</span>
714+
{{end}}
710715
</div>
711716
{{if not .IsForcePush}}
712717
{{template "repo/commits_list_small" dict "comment" . "root" $}}

web_src/js/features/repo-legacy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export function initRepoCommentForm() {
232232

233233
$(this).parent().find('.item').each(function () {
234234
$(this).removeClass('checked');
235-
$(this).find('.octicon').addClass('invisible');
235+
$(this).find('.octicon-check').addClass('invisible');
236236
});
237237

238238
if (selector === 'select-reviewers-modify' || selector === 'select-assignees-modify') {

web_src/less/_repository.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,17 @@
978978
margin-top: 4px;
979979
}
980980

981+
.comparebox {
982+
line-height: 32px;
983+
vertical-align: middle;
984+
985+
.compare.label {
986+
font-size: 1rem;
987+
margin: 0;
988+
border: 1px solid var(--color-light-border);
989+
}
990+
}
991+
981992
.comment-form-reply .footer {
982993
padding-bottom: 1em;
983994
}

0 commit comments

Comments
 (0)