Compare commits
25 Commits
v1.15.9
...
release/v1
Author | SHA1 | Date | |
---|---|---|---|
|
a93d5e12d4 | ||
|
abe2fd614e | ||
|
f5e19dcfd7 | ||
|
3182d4edaa | ||
|
f8deb116cc | ||
|
5a16cbdaf6 | ||
|
889bdf9196 | ||
|
147bcc3d0f | ||
ce272f2e53 | |||
|
9d9ad1b59f | ||
df57524c49 | |||
|
d60b5f1e89 | ||
f7f4129f52 | |||
|
21838225ab | ||
95f39457de | |||
6cb5069bf6 | |||
|
a6f9ebfeb9 | ||
14de28b876 | |||
|
e4120bbc89 | ||
37abfcaf8a | |||
c719841f0d | |||
f9e150002e | |||
|
2f4f2852fc | ||
b25a571bc9 | |||
|
f9bbed028c |
143
.drone.yml
143
.drone.yml
@ -531,7 +531,7 @@ steps:
|
||||
settings:
|
||||
acl: public-read
|
||||
bucket: gitea-artifacts
|
||||
endpoint: https://storage.gitea.io
|
||||
endpoint: https://ams3.digitaloceanspaces.com
|
||||
path_style: true
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
@ -552,7 +552,7 @@ steps:
|
||||
settings:
|
||||
acl: public-read
|
||||
bucket: gitea-artifacts
|
||||
endpoint: https://storage.gitea.io
|
||||
endpoint: https://ams3.digitaloceanspaces.com
|
||||
path_style: true
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
@ -627,7 +627,7 @@ steps:
|
||||
settings:
|
||||
acl: public-read
|
||||
bucket: gitea-artifacts
|
||||
endpoint: https://storage.gitea.io
|
||||
endpoint: https://ams3.digitaloceanspaces.com
|
||||
path_style: true
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
@ -817,6 +817,70 @@ steps:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: docker-linux-amd64-release-branch
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
depends_on:
|
||||
- testing-amd64
|
||||
- testing-arm64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- "refs/heads/release/v*"
|
||||
event:
|
||||
exclude:
|
||||
- cron
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: publish
|
||||
pull: always
|
||||
image: techknowlogick/drone-docker:latest
|
||||
settings:
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=off
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
- name: publish-rootless
|
||||
image: techknowlogick/drone-docker:latest
|
||||
settings:
|
||||
dockerfile: Dockerfile.rootless
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=off
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: docker-linux-arm64-dry-run
|
||||
@ -982,6 +1046,74 @@ steps:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: docker-linux-arm64-release-branch
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
depends_on:
|
||||
- testing-amd64
|
||||
- testing-arm64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- "refs/heads/release/v*"
|
||||
event:
|
||||
exclude:
|
||||
- cron
|
||||
|
||||
steps:
|
||||
- name: fetch-tags
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags --force
|
||||
|
||||
- name: publish
|
||||
pull: always
|
||||
image: techknowlogick/drone-docker:latest
|
||||
settings:
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=off
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
- name: publish-rootless
|
||||
image: techknowlogick/drone-docker:latest
|
||||
settings:
|
||||
dockerfile: Dockerfile.rootless
|
||||
auto_tag: false
|
||||
tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless
|
||||
repo: gitea/gitea
|
||||
build_args:
|
||||
- GOPROXY=off
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
from_secret: docker_username
|
||||
environment:
|
||||
PLUGIN_MIRROR:
|
||||
from_secret: plugin_mirror
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: docker-manifest-version
|
||||
@ -1041,6 +1173,7 @@ steps:
|
||||
auto_tag: false
|
||||
ignore_missing: true
|
||||
spec: docker/manifest.rootless.tmpl
|
||||
dump: true
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
@ -1052,6 +1185,7 @@ steps:
|
||||
auto_tag: false
|
||||
ignore_missing: true
|
||||
spec: docker/manifest.tmpl
|
||||
dump: true
|
||||
password:
|
||||
from_secret: docker_password
|
||||
username:
|
||||
@ -1060,6 +1194,7 @@ steps:
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/main
|
||||
- "refs/heads/release/v*"
|
||||
event:
|
||||
exclude:
|
||||
- cron
|
||||
@ -1067,6 +1202,8 @@ trigger:
|
||||
depends_on:
|
||||
- docker-linux-amd64-release
|
||||
- docker-linux-arm64-release
|
||||
- docker-linux-amd64-release-branch
|
||||
- docker-linux-arm64-release-branch
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
|
26
CHANGELOG.md
26
CHANGELOG.md
@ -4,6 +4,32 @@ This changelog goes through all the changes that have been made in each release
|
||||
without substantial changes to our git log; to see the highlights of what has
|
||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
|
||||
|
||||
## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29
|
||||
|
||||
* SECURITY
|
||||
* Only view milestones from current repo (#18414) (#18418)
|
||||
* BUGFIXES
|
||||
* Fix broken when no commits and default branch is not master (#18422) (#18424)
|
||||
* Fix commit's time (#18375) (#18409)
|
||||
* Fix restore without topic failure (#18387) (#18401)
|
||||
* Fix mermaid import in 1.15 (it uses ESModule now) (#18382)
|
||||
* Update to go/text 0.3.7 (#18336)
|
||||
* MISC
|
||||
* Upgrade EasyMDE to 2.16.1 (#18278) (#18279)
|
||||
|
||||
## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14
|
||||
|
||||
* BUGFIXES
|
||||
* Fix inconsistent PR comment counts (#18260) (#18261)
|
||||
* Fix release link broken (#18252) (#18253)
|
||||
* Fix update user from site administration page bug (#18250) (#18251)
|
||||
* Set HeadCommit when creating tags (#18116) (#18173)
|
||||
* Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)
|
||||
* Fix purple color in suggested label colors (#18241) (#18242)
|
||||
* SECURITY
|
||||
* Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206)
|
||||
|
||||
## [1.15.9](https://github.com/go-gitea/gitea/releases/tag/v1.15.9) - 2021-12-30
|
||||
|
||||
* BUGFIXES
|
||||
|
@ -1,4 +1,4 @@
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-rootless
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-rootless
|
||||
{{#if build.tags}}
|
||||
tags:
|
||||
{{#each build.tags}}
|
||||
@ -8,12 +8,12 @@ tags:
|
||||
{{/if}}
|
||||
manifests:
|
||||
-
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-amd64-rootless
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-amd64-rootless
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
-
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-arm64-rootless
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-arm64-rootless
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
||||
|
@ -1,20 +1,19 @@
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}
|
||||
{{#if build.tags}}
|
||||
tags:
|
||||
{{#each build.tags}}
|
||||
- {{this}}
|
||||
{{/each}}
|
||||
- "latest"
|
||||
{{/if}}
|
||||
manifests:
|
||||
-
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-amd64
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
-
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-arm64
|
||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-arm64
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
||||
variant: v8
|
||||
variant: v8
|
||||
|
2
go.mod
2
go.mod
@ -128,7 +128,7 @@ require (
|
||||
golang.org/x/net v0.0.0-20211020060615-d418f374d309
|
||||
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
|
||||
golang.org/x/text v0.3.6
|
||||
golang.org/x/text v0.3.7
|
||||
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
|
||||
golang.org/x/tools v0.1.0
|
||||
google.golang.org/protobuf v1.27.1 // indirect
|
||||
|
3
go.sum
3
go.sum
@ -1485,8 +1485,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
|
@ -762,13 +762,12 @@ func updateCommentInfos(e *xorm.Session, opts *CreateCommentOptions, comment *Co
|
||||
}
|
||||
}
|
||||
fallthrough
|
||||
case CommentTypeReview:
|
||||
fallthrough
|
||||
case CommentTypeComment:
|
||||
if _, err = e.Exec("UPDATE `issue` SET num_comments=num_comments+1 WHERE id=?", opts.Issue.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fallthrough
|
||||
case CommentTypeReview:
|
||||
// Check attachments
|
||||
attachments, err := getAttachmentsByUUIDs(e, opts.Attachments)
|
||||
if err != nil {
|
||||
|
@ -127,22 +127,6 @@ func GetMilestoneByRepoIDANDName(repoID int64, name string) (*Milestone, error)
|
||||
return &mile, nil
|
||||
}
|
||||
|
||||
// GetMilestoneByID returns the milestone via id .
|
||||
func GetMilestoneByID(id int64) (*Milestone, error) {
|
||||
return getMilestoneByID(x, id)
|
||||
}
|
||||
|
||||
func getMilestoneByID(e Engine, id int64) (*Milestone, error) {
|
||||
var m Milestone
|
||||
has, err := e.ID(id).Get(&m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrMilestoneNotExist{ID: id, RepoID: 0}
|
||||
}
|
||||
return &m, nil
|
||||
}
|
||||
|
||||
// UpdateMilestone updates information of given milestone.
|
||||
func UpdateMilestone(m *Milestone, oldIsClosed bool) error {
|
||||
sess := x.NewSession()
|
||||
|
@ -1095,7 +1095,7 @@ func updateUser(e Engine, u *User, changePrimaryEmail bool) error {
|
||||
if _, err := e.Insert(&emailAddress); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if _, err := e.ID(emailAddress).Cols("is_primary").Update(&EmailAddress{
|
||||
} else if _, err := e.ID(emailAddress.ID).Cols("is_primary").Update(&EmailAddress{
|
||||
IsPrimary: true,
|
||||
}); err != nil {
|
||||
return err
|
||||
|
@ -75,16 +75,16 @@ func InitRepository(repoPath string, bare bool) error {
|
||||
|
||||
// IsEmpty Check if repository is empty.
|
||||
func (repo *Repository) IsEmpty() (bool, error) {
|
||||
var errbuf strings.Builder
|
||||
if err := NewCommand("log", "-1").RunInDirPipeline(repo.Path, nil, &errbuf); err != nil {
|
||||
if strings.Contains(errbuf.String(), "fatal: bad default revision 'HEAD'") ||
|
||||
strings.Contains(errbuf.String(), "fatal: your current branch 'master' does not have any commits yet") {
|
||||
return true, nil
|
||||
}
|
||||
var errbuf, output strings.Builder
|
||||
if err := NewCommand("rev-list", "--all", "--count", "--max-count=1").RunInDirPipeline(repo.Path, &output, &errbuf); err != nil {
|
||||
return true, fmt.Errorf("check empty: %v - %s", err, errbuf.String())
|
||||
}
|
||||
|
||||
return false, nil
|
||||
c, err := strconv.Atoi(strings.TrimSpace(output.String()))
|
||||
if err != nil {
|
||||
return true, fmt.Errorf("check empty: convert %s to count failed: %v", output.String(), err)
|
||||
}
|
||||
return c == 0, nil
|
||||
}
|
||||
|
||||
// CloneRepoOptions options when clone a repository
|
||||
|
@ -98,6 +98,9 @@ func (r *RepositoryRestorer) GetTopics() ([]string, error) {
|
||||
|
||||
bs, err := ioutil.ReadFile(p)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
1187
package-lock.json
generated
1187
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -9,10 +9,10 @@
|
||||
"@claviska/jquery-minicolors": "2.3.5",
|
||||
"@primer/octicons": "13.0.0",
|
||||
"add-asset-webpack-plugin": "2.0.1",
|
||||
"codemirror": "5.61.0",
|
||||
"codemirror": "5.65.0",
|
||||
"css-loader": "5.2.4",
|
||||
"dropzone": "5.9.2",
|
||||
"easymde": "2.15.0",
|
||||
"easymde": "2.16.1",
|
||||
"esbuild-loader": "2.13.0",
|
||||
"escape-goat": "4.0.0",
|
||||
"fast-glob": "3.2.5",
|
||||
@ -22,7 +22,7 @@
|
||||
"less": "4.1.1",
|
||||
"less-loader": "8.1.1",
|
||||
"license-checker-webpack-plugin": "0.2.1",
|
||||
"mermaid": "8.10.1",
|
||||
"mermaid": "8.13.8",
|
||||
"mini-css-extract-plugin": "1.6.0",
|
||||
"monaco-editor": "0.24.0",
|
||||
"monaco-editor-webpack-plugin": "3.1.0",
|
||||
|
@ -51,17 +51,15 @@ const (
|
||||
issueTemplateTitleKey = "IssueTemplateTitle"
|
||||
)
|
||||
|
||||
var (
|
||||
// IssueTemplateCandidates issue templates
|
||||
IssueTemplateCandidates = []string{
|
||||
"ISSUE_TEMPLATE.md",
|
||||
"issue_template.md",
|
||||
".gitea/ISSUE_TEMPLATE.md",
|
||||
".gitea/issue_template.md",
|
||||
".github/ISSUE_TEMPLATE.md",
|
||||
".github/issue_template.md",
|
||||
}
|
||||
)
|
||||
// IssueTemplateCandidates issue templates
|
||||
var IssueTemplateCandidates = []string{
|
||||
"ISSUE_TEMPLATE.md",
|
||||
"issue_template.md",
|
||||
".gitea/ISSUE_TEMPLATE.md",
|
||||
".gitea/issue_template.md",
|
||||
".github/ISSUE_TEMPLATE.md",
|
||||
".github/issue_template.md",
|
||||
}
|
||||
|
||||
// MustAllowUserComment checks to make sure if an issue is locked.
|
||||
// If locked and user has permissions to write to the repository,
|
||||
@ -239,7 +237,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
|
||||
}
|
||||
}
|
||||
|
||||
var issueList = models.IssueList(issues)
|
||||
issueList := models.IssueList(issues)
|
||||
approvalCounts, err := issueList.GetApprovalCounts()
|
||||
if err != nil {
|
||||
ctx.ServerError("ApprovalCounts", err)
|
||||
@ -422,7 +420,6 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repos
|
||||
}
|
||||
|
||||
func retrieveProjects(ctx *context.Context, repo *models.Repository) {
|
||||
|
||||
var err error
|
||||
|
||||
ctx.Data["OpenProjects"], _, err = models.GetProjects(models.ProjectSearchOptions{
|
||||
@ -781,7 +778,7 @@ func NewIssue(ctx *context.Context) {
|
||||
|
||||
milestoneID := ctx.QueryInt64("milestone")
|
||||
if milestoneID > 0 {
|
||||
milestone, err := models.GetMilestoneByID(milestoneID)
|
||||
milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, milestoneID)
|
||||
if err != nil {
|
||||
log.Error("GetMilestoneByID: %d: %v", milestoneID, err)
|
||||
} else {
|
||||
@ -865,7 +862,7 @@ func ValidateRepoMetas(ctx *context.Context, form forms.CreateIssueForm, isPull
|
||||
// Check milestone.
|
||||
milestoneID := form.MilestoneID
|
||||
if milestoneID > 0 {
|
||||
ctx.Data["Milestone"], err = repo.GetMilestoneByID(milestoneID)
|
||||
ctx.Data["Milestone"], err = models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, milestoneID)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetMilestoneByID", err)
|
||||
return nil, nil, 0, 0
|
||||
@ -2446,7 +2443,7 @@ func filterXRefComments(ctx *context.Context, issue *models.Issue) error {
|
||||
// GetIssueAttachments returns attachments for the issue
|
||||
func GetIssueAttachments(ctx *context.Context) {
|
||||
issue := GetActionIssue(ctx)
|
||||
var attachments = make([]*api.Attachment, len(issue.Attachments))
|
||||
attachments := make([]*api.Attachment, len(issue.Attachments))
|
||||
for i := 0; i < len(issue.Attachments); i++ {
|
||||
attachments[i] = convert.ToReleaseAttachment(issue.Attachments[i])
|
||||
}
|
||||
@ -2460,7 +2457,7 @@ func GetCommentAttachments(ctx *context.Context) {
|
||||
ctx.NotFoundOrServerError("GetCommentByID", models.IsErrCommentNotExist, err)
|
||||
return
|
||||
}
|
||||
var attachments = make([]*api.Attachment, 0)
|
||||
attachments := make([]*api.Attachment, 0)
|
||||
if comment.Type == models.CommentTypeComment {
|
||||
if err := comment.LoadAttachments(); err != nil {
|
||||
ctx.ServerError("LoadAttachments", err)
|
||||
|
@ -77,7 +77,14 @@ func handleMigrateError(ctx *context.Context, owner *models.User, err error, nam
|
||||
case migrations.IsTwoFactorAuthError(err):
|
||||
ctx.RenderWithErr(ctx.Tr("form.2fa_auth_required"), tpl, form)
|
||||
case models.IsErrReachLimitOfRepo(err):
|
||||
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.MaxCreationLimit()), tpl, form)
|
||||
var msg string
|
||||
maxCreationLimit := owner.MaxCreationLimit()
|
||||
if maxCreationLimit == 1 {
|
||||
msg = ctx.Tr("repo.form.reach_limit_of_creation_1", maxCreationLimit)
|
||||
} else {
|
||||
msg = ctx.Tr("repo.form.reach_limit_of_creation_n", maxCreationLimit)
|
||||
}
|
||||
ctx.RenderWithErr(msg, tpl, form)
|
||||
case models.IsErrRepoAlreadyExist(err):
|
||||
ctx.Data["Err_RepoName"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tpl, form)
|
||||
|
@ -268,7 +268,7 @@ func DeleteMilestone(ctx *context.Context) {
|
||||
// MilestoneIssuesAndPulls lists all the issues and pull requests of the milestone
|
||||
func MilestoneIssuesAndPulls(ctx *context.Context) {
|
||||
milestoneID := ctx.ParamsInt64(":id")
|
||||
milestone, err := models.GetMilestoneByID(milestoneID)
|
||||
milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, milestoneID)
|
||||
if err != nil {
|
||||
if models.IsErrMilestoneNotExist(err) {
|
||||
ctx.NotFound("GetMilestoneByID", err)
|
||||
|
@ -158,7 +158,14 @@ func Create(ctx *context.Context) {
|
||||
func handleCreateError(ctx *context.Context, owner *models.User, err error, name string, tpl base.TplName, form interface{}) {
|
||||
switch {
|
||||
case models.IsErrReachLimitOfRepo(err):
|
||||
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.MaxCreationLimit()), tpl, form)
|
||||
var msg string
|
||||
maxCreationLimit := owner.MaxCreationLimit()
|
||||
if maxCreationLimit == 1 {
|
||||
msg = ctx.Tr("repo.form.reach_limit_of_creation_1", maxCreationLimit)
|
||||
} else {
|
||||
msg = ctx.Tr("repo.form.reach_limit_of_creation_n", maxCreationLimit)
|
||||
}
|
||||
ctx.RenderWithErr(msg, tpl, form)
|
||||
case models.IsErrRepoAlreadyExist(err):
|
||||
ctx.Data["Err_RepoName"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tpl, form)
|
||||
|
@ -533,7 +533,12 @@ func SettingsPost(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if !ctx.Repo.Owner.CanCreateRepo() {
|
||||
ctx.Flash.Error(ctx.Tr("repo.form.reach_limit_of_creation", ctx.User.MaxCreationLimit()))
|
||||
maxCreationLimit := ctx.Repo.Owner.MaxCreationLimit()
|
||||
if maxCreationLimit == 1 {
|
||||
ctx.Flash.Error(ctx.Tr("repo.form.reach_limit_of_creation_1", maxCreationLimit))
|
||||
} else {
|
||||
ctx.Flash.Error(ctx.Tr("repo.form.reach_limit_of_creation_n", maxCreationLimit))
|
||||
}
|
||||
ctx.Redirect(repo.Link() + "/settings")
|
||||
return
|
||||
}
|
||||
|
@ -69,13 +69,17 @@ func createTag(gitRepo *git.Repository, rel *models.Release, msg string) (bool,
|
||||
created = true
|
||||
rel.LowerTagName = strings.ToLower(rel.TagName)
|
||||
|
||||
commits := repository.NewPushCommits()
|
||||
commits.HeadCommit = repository.CommitToPushCommit(commit)
|
||||
commits.CompareURL = rel.Repo.ComposeCompareURL(git.EmptySHA, commit.ID.String())
|
||||
|
||||
notification.NotifyPushCommits(
|
||||
rel.Publisher, rel.Repo,
|
||||
&repository.PushUpdateOptions{
|
||||
RefFullName: git.TagPrefix + rel.TagName,
|
||||
OldCommitID: git.EmptySHA,
|
||||
NewCommitID: commit.ID.String(),
|
||||
}, repository.NewPushCommits())
|
||||
}, commits)
|
||||
notification.NotifyCreateRef(rel.Publisher, rel.Repo, "tag", git.TagPrefix+rel.TagName)
|
||||
rel.CreatedUnix = timeutil.TimeStampNow()
|
||||
}
|
||||
|
@ -115,13 +115,22 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
|
||||
delTags = append(delTags, tagName)
|
||||
notification.NotifyDeleteRef(pusher, repo, "tag", opts.RefFullName)
|
||||
} else { // is new tag
|
||||
newCommit, err := gitRepo.GetCommit(opts.NewCommitID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gitRepo.GetCommit: %v", err)
|
||||
}
|
||||
|
||||
commits := repo_module.NewPushCommits()
|
||||
commits.HeadCommit = repo_module.CommitToPushCommit(newCommit)
|
||||
commits.CompareURL = repo.ComposeCompareURL(git.EmptySHA, opts.NewCommitID)
|
||||
|
||||
notification.NotifyPushCommits(
|
||||
pusher, repo,
|
||||
&repo_module.PushUpdateOptions{
|
||||
RefFullName: git.TagPrefix + tagName,
|
||||
OldCommitID: git.EmptySHA,
|
||||
NewCommitID: opts.NewCommitID,
|
||||
}, repo_module.NewPushCommits())
|
||||
}, commits)
|
||||
|
||||
addTags = append(addTags, tagName)
|
||||
notification.NotifyCreateRef(pusher, repo, "tag", opts.RefFullName)
|
||||
|
@ -76,7 +76,11 @@
|
||||
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
|
||||
{{if .Committer}}
|
||||
<td class="text right aligned">{{TimeSince .Committer.When $.Lang}}</td>
|
||||
{{else}}
|
||||
<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a>
|
||||
<a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a>
|
||||
<a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a>
|
||||
<a class="color" style="background-color:#53e917" data-color-hex="#53e917"></a>
|
||||
<a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a>
|
||||
<a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a>
|
||||
<a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a>
|
||||
<a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a>
|
||||
|
@ -99,7 +99,7 @@
|
||||
<a href="{{AppSubUrl}}/{{.Publisher.Name}}">{{.Publisher.Name}}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
<span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | EscapePound}}...{{.Target}}">{{$.i18n.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.i18n.Tr "repo.release.ahead.target" $.DefaultBranch}}</span>
|
||||
<span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | EscapePound}}...{{if .Target}}{{.Target}}{{else}}{{$.DefaultBranch}}{{end}}">{{$.i18n.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.i18n.Tr "repo.release.ahead.target" $.DefaultBranch}}</span>
|
||||
</p>
|
||||
<div class="download">
|
||||
{{if $.Permission.CanRead $.UnitTypeCode}}
|
||||
@ -135,7 +135,7 @@
|
||||
<span class="time">{{TimeSinceUnix .CreatedUnix $.Lang}}</span>
|
||||
{{end}}
|
||||
{{if not .IsDraft}}
|
||||
| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | EscapePound}}...{{.Target}}">{{$.i18n.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.i18n.Tr "repo.release.ahead.target" .Target}}</span>
|
||||
| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | EscapePound}}...{{if .Target}}{{.Target}}{{else}}{{$.DefaultBranch}}{{end}}">{{$.i18n.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.i18n.Tr "repo.release.ahead.target" .Target}}</span>
|
||||
{{end}}
|
||||
</p>
|
||||
<div class="markup desc">
|
||||
|
@ -30,7 +30,7 @@
|
||||
{{end}}
|
||||
</span>
|
||||
</th>
|
||||
<th class="text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
|
||||
<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -117,7 +117,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .Content}}
|
||||
<div class="content">
|
||||
<div class="markup content">
|
||||
{{.RenderedContent|Str2html}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
43
vendor/golang.org/x/text/internal/language/language.go
generated
vendored
43
vendor/golang.org/x/text/internal/language/language.go
generated
vendored
@ -251,6 +251,13 @@ func (t Tag) Parent() Tag {
|
||||
|
||||
// ParseExtension parses s as an extension and returns it on success.
|
||||
func ParseExtension(s string) (ext string, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
ext = ""
|
||||
err = ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
scan := makeScannerString(s)
|
||||
var end int
|
||||
if n := len(scan.token); n != 1 {
|
||||
@ -461,7 +468,14 @@ func (t Tag) findTypeForKey(key string) (start, sep, end int, hasExt bool) {
|
||||
// ParseBase parses a 2- or 3-letter ISO 639 code.
|
||||
// It returns a ValueError if s is a well-formed but unknown language identifier
|
||||
// or another error if another error occurred.
|
||||
func ParseBase(s string) (Language, error) {
|
||||
func ParseBase(s string) (l Language, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
l = 0
|
||||
err = ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
if n := len(s); n < 2 || 3 < n {
|
||||
return 0, ErrSyntax
|
||||
}
|
||||
@ -472,7 +486,14 @@ func ParseBase(s string) (Language, error) {
|
||||
// ParseScript parses a 4-letter ISO 15924 code.
|
||||
// It returns a ValueError if s is a well-formed but unknown script identifier
|
||||
// or another error if another error occurred.
|
||||
func ParseScript(s string) (Script, error) {
|
||||
func ParseScript(s string) (scr Script, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
scr = 0
|
||||
err = ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
if len(s) != 4 {
|
||||
return 0, ErrSyntax
|
||||
}
|
||||
@ -489,7 +510,14 @@ func EncodeM49(r int) (Region, error) {
|
||||
// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
|
||||
// It returns a ValueError if s is a well-formed but unknown region identifier
|
||||
// or another error if another error occurred.
|
||||
func ParseRegion(s string) (Region, error) {
|
||||
func ParseRegion(s string) (r Region, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
r = 0
|
||||
err = ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
if n := len(s); n < 2 || 3 < n {
|
||||
return 0, ErrSyntax
|
||||
}
|
||||
@ -578,7 +606,14 @@ type Variant struct {
|
||||
|
||||
// ParseVariant parses and returns a Variant. An error is returned if s is not
|
||||
// a valid variant.
|
||||
func ParseVariant(s string) (Variant, error) {
|
||||
func ParseVariant(s string) (v Variant, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
v = Variant{}
|
||||
err = ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
s = strings.ToLower(s)
|
||||
if id, ok := variantIndex[s]; ok {
|
||||
return Variant{id, s}, nil
|
||||
|
7
vendor/golang.org/x/text/internal/language/parse.go
generated
vendored
7
vendor/golang.org/x/text/internal/language/parse.go
generated
vendored
@ -232,6 +232,13 @@ func Parse(s string) (t Tag, err error) {
|
||||
if s == "" {
|
||||
return Und, ErrSyntax
|
||||
}
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
t = Und
|
||||
err = ErrSyntax
|
||||
return
|
||||
}
|
||||
}()
|
||||
if len(s) <= maxAltTaglen {
|
||||
b := [maxAltTaglen]byte{}
|
||||
for i, c := range s {
|
||||
|
22
vendor/golang.org/x/text/language/parse.go
generated
vendored
22
vendor/golang.org/x/text/language/parse.go
generated
vendored
@ -43,6 +43,13 @@ func Parse(s string) (t Tag, err error) {
|
||||
// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
|
||||
// The resulting tag is canonicalized using the canonicalization type c.
|
||||
func (c CanonType) Parse(s string) (t Tag, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
t = Tag{}
|
||||
err = language.ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
tt, err := language.Parse(s)
|
||||
if err != nil {
|
||||
return makeTag(tt), err
|
||||
@ -79,6 +86,13 @@ func Compose(part ...interface{}) (t Tag, err error) {
|
||||
// tag is returned after canonicalizing using CanonType c. If one or more errors
|
||||
// are encountered, one of the errors is returned.
|
||||
func (c CanonType) Compose(part ...interface{}) (t Tag, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
t = Tag{}
|
||||
err = language.ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
var b language.Builder
|
||||
if err = update(&b, part...); err != nil {
|
||||
return und, err
|
||||
@ -142,6 +156,14 @@ var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight")
|
||||
// Tags with a weight of zero will be dropped. An error will be returned if the
|
||||
// input could not be parsed.
|
||||
func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
tag = nil
|
||||
q = nil
|
||||
err = language.ErrSyntax
|
||||
}
|
||||
}()
|
||||
|
||||
var entry string
|
||||
for s != "" {
|
||||
if entry, s = split(s, ','); entry == "" {
|
||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -921,7 +921,7 @@ golang.org/x/sys/unix
|
||||
golang.org/x/sys/windows
|
||||
golang.org/x/sys/windows/svc
|
||||
golang.org/x/sys/windows/svc/debug
|
||||
# golang.org/x/text v0.3.6
|
||||
# golang.org/x/text v0.3.7
|
||||
## explicit
|
||||
golang.org/x/text/encoding
|
||||
golang.org/x/text/encoding/charmap
|
||||
|
@ -11,7 +11,7 @@ function displayError(el, err) {
|
||||
export async function renderMermaid(els) {
|
||||
if (!els || !els.length) return;
|
||||
|
||||
const mermaid = await import(/* webpackChunkName: "mermaid" */'mermaid');
|
||||
const {default: mermaid} = await import(/* webpackChunkName: "mermaid" */'mermaid');
|
||||
|
||||
mermaid.initialize({
|
||||
mermaid: {
|
||||
|
Reference in New Issue
Block a user