mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-16 17:10:36 +00:00
Fix some trivial problems (#36336)
1. correctly parse git protocol's "OldCommit NewCommit RefName" line, it should be explicitly split by space 2. add missing "return" in CreatePullRequest 3. add comments for "/user.keys" and "/user.gpg" outputs 4. trim space for the "commit status context name" to follow the same behavior of git_model.NewCommitStatus
This commit is contained in:
@@ -500,6 +500,7 @@ func CreatePullRequest(ctx *context.APIContext) {
|
||||
unitPullRequest, err := ctx.Repo.Repository.GetUnit(ctx, unit.TypePullRequests)
|
||||
if err != nil {
|
||||
ctx.APIErrorInternal(err)
|
||||
return
|
||||
}
|
||||
|
||||
prIssue := &issues_model.Issue{
|
||||
|
||||
@@ -660,6 +660,8 @@ func ShowSSHKeys(ctx *context.Context) {
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
// "authorized_keys" file format: "#" followed by comment line per key
|
||||
buf.WriteString("# Gitea isn't a key server. The keys are exported as the user uploaded and might not have been fully verified.\n")
|
||||
for i := range keys {
|
||||
buf.WriteString(keys[i].OmitEmail())
|
||||
buf.WriteString("\n")
|
||||
@@ -695,6 +697,8 @@ func ShowGPGKeys(ctx *context.Context) {
|
||||
var buf bytes.Buffer
|
||||
|
||||
headers := make(map[string]string)
|
||||
// https://www.rfc-editor.org/rfc/rfc4880
|
||||
headers["Comment"] = "Gitea isn't a key server. The keys are exported as the user uploaded and might not have been fully verified."
|
||||
if len(failedEntitiesID) > 0 { // If some key need re-import to be exported
|
||||
headers["Note"] = "The keys with the following IDs couldn't be exported and need to be reuploaded " + strings.Join(failedEntitiesID, ", ")
|
||||
} else if len(entities) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user