1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Make API "compare" accept commit IDs (#32801)

This commit is contained in:
wxiaoguang
2024-12-12 16:10:09 +08:00
committed by GitHub
parent 01b1896bf5
commit 22bf2ca6ba
10 changed files with 154 additions and 124 deletions

View File

@ -9,7 +9,6 @@ import (
"fmt"
"html/template"
"net/http"
"net/url"
"strconv"
"strings"
@ -114,7 +113,6 @@ func MustAllowPulls(ctx *context.Context) {
// User can send pull request if owns a forked repository.
if ctx.IsSigned && repo_model.HasForkedRepo(ctx, ctx.Doer.ID, ctx.Repo.Repository.ID) {
ctx.Repo.PullRequest.Allowed = true
ctx.Repo.PullRequest.HeadInfoSubURL = url.PathEscape(ctx.Doer.Name) + ":" + util.PathEscapeSegments(ctx.Repo.BranchName)
}
}