Skip to content

Commit b792231

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Allow set branch protection in an empty repository (go-gitea#32095) Fix panic when cloning with wrong ssh format. (go-gitea#32076) Fix bug in getting merged pull request by commit (go-gitea#32079) [skip ci] Updated translations via Crowdin use rebuilt mssql-2017 image (go-gitea#32109) Fix Bug in Issue/pulls list (go-gitea#32081)
2 parents 521030e + 6eb5950 commit b792231

File tree

12 files changed

+66
-31
lines changed

12 files changed

+66
-31
lines changed

.github/workflows/pull-db-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ jobs:
198198
test-mssql:
199199
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
200200
needs: files-changed
201-
runs-on: ubuntu-latest
201+
# specifying the version of ubuntu in use as mssql fails on newer kernels
202+
# pending resolution from vendor
203+
runs-on: ubuntu-20.04
202204
services:
203205
mssql:
204-
# some images before 2024-04 can't run on new kernels
205-
image: mcr.microsoft.com/mssql/server:2019-latest
206+
image: mcr.microsoft.com/mssql/server:2017-latest
206207
env:
207208
ACCEPT_EULA: Y
208209
MSSQL_PID: Standard

cmd/serv.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ func runServ(c *cli.Context) error {
143143
return nil
144144
}
145145

146+
defer func() {
147+
if err := recover(); err != nil {
148+
_ = fail(ctx, "Internal Server Error", "Panic: %v\n%s", err, log.Stack(2))
149+
}
150+
}()
151+
146152
keys := strings.Split(c.Args().First(), "-")
147153
if len(keys) != 2 || keys[0] != "key" {
148154
return fail(ctx, "Key ID format error", "Invalid key argument: %s", c.Args().First())
@@ -189,10 +195,7 @@ func runServ(c *cli.Context) error {
189195
}
190196

191197
verb := words[0]
192-
repoPath := words[1]
193-
if repoPath[0] == '/' {
194-
repoPath = repoPath[1:]
195-
}
198+
repoPath := strings.TrimPrefix(words[1], "/")
196199

197200
var lfsVerb string
198201
if verb == lfsAuthenticateVerb {

options/locale/locale_ja-JP.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ filter.public=公開
159159
filter.private=プライベート
160160

161161
no_results_found=見つかりません。
162+
internal_error_skipped=内部エラーが発生しましたがスキップされました: %s
162163

163164
[search]
164165
search=検索…
@@ -177,6 +178,8 @@ code_search_by_git_grep=現在のコード検索は "git grep" によって行
177178
package_kind=パッケージを検索...
178179
project_kind=プロジェクトを検索...
179180
branch_kind=ブランチを検索...
181+
tag_kind=タグを検索...
182+
tag_tooltip=一致するタグを検索します。任意のシーケンスに一致させるには '%' を使用してください。
180183
commit_kind=コミットを検索...
181184
runner_kind=ランナーを検索...
182185
no_results=一致する結果が見つかりませんでした
@@ -1174,6 +1177,11 @@ migrate.gogs.description=notabug.org やその他の Gogs インスタンスか
11741177
migrate.onedev.description=code.onedev.io やその他の OneDev インスタンスからデータを移行します。
11751178
migrate.codebase.description=codebasehq.com からデータを移行します。
11761179
migrate.gitbucket.description=GitBucket インスタンスからデータを移行します。
1180+
migrate.codecommit.description=AWS CodeCommitからデータを移行します。
1181+
migrate.codecommit.aws_access_key_id=AWS アクセスキー ID
1182+
migrate.codecommit.aws_secret_access_key=AWSシークレットアクセスキー
1183+
migrate.codecommit.https_git_credentials_username=HTTPS Git 認証情報 ユーザー名
1184+
migrate.codecommit.https_git_credentials_password=HTTPS Git 認証情報 パスワード
11771185
migrate.migrating_git=Gitデータ移行中
11781186
migrate.migrating_topics=トピック移行中
11791187
migrate.migrating_milestones=マイルストーン移行中
@@ -1251,6 +1259,7 @@ ambiguous_runes_header=このファイルには曖昧(ambiguous)なUnicode文字
12511259
ambiguous_runes_description=このファイルには、他の文字と見間違える可能性があるUnicode文字が含まれています。 それが意図的なものと考えられる場合は、この警告を無視して構いません。 それらの文字を表示するにはエスケープボタンを使用します。
12521260
invisible_runes_line=`この行には不可視のUnicode文字があります`
12531261
ambiguous_runes_line=`この行には曖昧(ambiguous)なUnicode文字があります`
1262+
ambiguous_character=`%[1]c [U+%04[1]X] は %[2]c [U+%04[2]X] と混同するおそれがあります`
12541263

12551264
escape_control_characters=エスケープ
12561265
unescape_control_characters=エスケープ解除
@@ -1748,6 +1757,11 @@ issues.review.resolve_conversation=解決済みにする
17481757
issues.review.un_resolve_conversation=未解決にする
17491758
issues.review.resolved_by=がこの会話を解決済みにしました
17501759
issues.review.commented=コメント
1760+
issues.review.official=承認済み
1761+
issues.review.requested=レビュー待ち
1762+
issues.review.rejected=変更要請済み
1763+
issues.review.stale=承認後に更新されました
1764+
issues.review.unofficial=カウントされない承認
17511765
issues.assignee.error=予期しないエラーにより、一部の担当者を追加できませんでした。
17521766
issues.reference_issue.body=内容
17531767
issues.content_history.deleted=削除しました
@@ -1821,6 +1835,8 @@ pulls.is_empty=このブランチの変更は既にターゲットブランチ
18211835
pulls.required_status_check_failed=いくつかの必要なステータスチェックが成功していません。
18221836
pulls.required_status_check_missing=必要なチェックがいくつか抜けています。
18231837
pulls.required_status_check_administrator=管理者であるため、このプルリクエストをマージすることは可能です。
1838+
pulls.blocked_by_approvals=このプルリクエストはまだ必要な承認数を満たしていません。 公式の承認を %[1]d / %[2]d 得ています。
1839+
pulls.blocked_by_approvals_whitelisted=このプルリクエストはまだ必要な承認数を満たしていません。 許可リストのユーザーまたはチームからの承認を %[1]d / %[2]d 得ています。
18241840
pulls.blocked_by_rejection=このプルリクエストは公式レビューアにより変更要請されています。
18251841
pulls.blocked_by_official_review_requests=このプルリクエストには公式レビュー依頼があります。
18261842
pulls.blocked_by_outdated_branch=このプルリクエストは遅れのためブロックされています。

routers/api/v1/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,8 @@ func Routes() *web.Router {
12861286
m.Group("/{ref}", func() {
12871287
m.Get("/status", repo.GetCombinedCommitStatusByRef)
12881288
m.Get("/statuses", repo.GetCommitStatusesByRef)
1289+
}, context.ReferencesGitRepo())
1290+
m.Group("/{sha}", func() {
12891291
m.Get("/pull", repo.GetCommitPullRequest)
12901292
}, context.ReferencesGitRepo())
12911293
}, reqRepoReader(unit.TypeCode))

routers/api/v1/repo/commits.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,11 @@ func DownloadCommitDiffOrPatch(ctx *context.APIContext) {
325325
}
326326
}
327327

328-
// GetCommitPullRequest returns the pull request of the commit
328+
// GetCommitPullRequest returns the merged pull request of the commit
329329
func GetCommitPullRequest(ctx *context.APIContext) {
330330
// swagger:operation GET /repos/{owner}/{repo}/commits/{sha}/pull repository repoGetCommitPullRequest
331331
// ---
332-
// summary: Get the pull request of the commit
332+
// summary: Get the merged pull request of the commit
333333
// produces:
334334
// - application/json
335335
// parameters:
@@ -354,7 +354,7 @@ func GetCommitPullRequest(ctx *context.APIContext) {
354354
// "404":
355355
// "$ref": "#/responses/notFound"
356356

357-
pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam(":sha"))
357+
pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam("sha"))
358358
if err != nil {
359359
if issues_model.IsErrPullRequestNotExist(err) {
360360
ctx.Error(http.StatusNotFound, "GetPullRequestByMergedCommit", err)

routers/web/repo/issue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption opt
467467
ctx.Data["AssigneeID"] = assigneeID
468468
ctx.Data["PosterID"] = posterID
469469
ctx.Data["Keyword"] = keyword
470+
ctx.Data["IsShowClosed"] = isShowClosed
470471
switch {
471472
case isShowClosed.Value():
472473
ctx.Data["State"] = "closed"

routers/web/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ func registerRoutes(m *web.Router) {
10691069
m.Combo("/edit").Get(repo_setting.SettingsProtectedBranch).
10701070
Post(web.Bind(forms.ProtectBranchForm{}), context.RepoMustNotBeArchived(), repo_setting.SettingsProtectedBranchPost)
10711071
m.Post("/{id}/delete", repo_setting.DeleteProtectedBranchRulePost)
1072-
}, repo.MustBeNotEmpty)
1072+
})
10731073

10741074
m.Group("/tags", func() {
10751075
m.Get("", repo_setting.ProtectedTags)

templates/repo/issue/filter_actions.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="ui secondary filter menu">
22
{{if not .Repository.IsArchived}}
33
<!-- Action Button -->
4-
{{if .IsShowClosed}}
4+
{{if and .IsShowClosed.Has .IsShowClosed.Value}}
55
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
6-
{{else}}
6+
{{else if and .IsShowClosed.Has (not .IsShowClosed.Value)}}
77
<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
88
{{end}}
99
{{if $.IsRepoAdmin}}

templates/repo/settings/branches.tmpl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@
1515
<form class="tw-flex" action="{{.Link}}" method="post">
1616
{{.CsrfTokenHtml}}
1717
<input type="hidden" name="action" value="default_branch">
18-
{{if not .Repository.IsEmpty}}
19-
<div class="ui dropdown selection search tw-flex-1 tw-mr-2 tw-max-w-96">
20-
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
21-
<input type="hidden" name="branch" value="{{.Repository.DefaultBranch}}">
22-
<div class="default text">{{.Repository.DefaultBranch}}</div>
23-
<div class="menu">
24-
{{range .Branches}}
25-
<div class="item" data-value="{{.}}">{{.}}</div>
26-
{{end}}
27-
</div>
18+
<div class="ui dropdown selection search tw-flex-1 tw-mr-2 tw-max-w-96">
19+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
20+
<input type="hidden" name="branch" value="{{.Repository.DefaultBranch}}">
21+
<div class="default text">{{.Repository.DefaultBranch}}</div>
22+
<div class="menu">
23+
{{range .Branches}}
24+
<div class="item" data-value="{{.}}">{{.}}</div>
25+
{{end}}
2826
</div>
29-
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.branches.update_default_branch"}}</button>
30-
{{end}}
27+
</div>
28+
<button class="ui primary button"{{if .Repository.IsEmpty}} disabled{{end}}>{{ctx.Locale.Tr "repo.settings.branches.update_default_branch"}}</button>
3129
</form>
3230
</div>
3331

templates/repo/settings/navbar.tmpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
</a>
1414
{{end}}
1515
{{if .Repository.UnitEnabled $.Context ctx.Consts.RepoUnitTypeCode}}
16-
{{if not .Repository.IsEmpty}}
17-
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
18-
{{ctx.Locale.Tr "repo.settings.branches"}}
19-
</a>
20-
{{end}}
16+
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
17+
{{ctx.Locale.Tr "repo.settings.branches"}}
18+
</a>
2119
<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
2220
{{ctx.Locale.Tr "repo.settings.tags"}}
2321
</a>

0 commit comments

Comments
 (0)