|
|
@@ -432,7 +432,7 @@ func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository, isPull boo |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
brs, _, err := ctx.Repo.GitRepo.GetBranches(0,0) |
|
|
|
brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("GetBranches", err) |
|
|
|
return nil |
|
|
@@ -1302,6 +1302,29 @@ func UpdateIssueContent(ctx *context.Context) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// UpdateIssueRef change issue's code reference |
|
|
|
func UpdateIssueRef(ctx *context.Context) { |
|
|
|
issue := GetActionIssue(ctx) |
|
|
|
if ctx.Written() { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)) { |
|
|
|
ctx.Error(403) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
ref := ctx.Query("ref") |
|
|
|
if err := issue_service.ChangeRef(issue, ctx.User, ref); err != nil { |
|
|
|
ctx.ServerError("ChangeRef", err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
ctx.JSON(200, map[string]interface{}{ |
|
|
|
"ref": issue.Ref, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// UpdateIssueMilestone change issue's milestone |
|
|
|
func UpdateIssueMilestone(ctx *context.Context) { |
|
|
|
issues := getActionIssues(ctx) |
|
|
|