Make git push options accept short name (#32245)

Just like what most CLI parsers do: `--opt` means `opt=true`

Then users could use `-o force-push` as `-o force-push=true`
This commit is contained in:
2024-10-12 13:42:10 +08:00
committed by GitHub
parent 900ac62251
commit afa8dd45af
7 changed files with 149 additions and 44 deletions

View File

@ -208,7 +208,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
return
}
cols := make([]string, 0, len(opts.GitPushOptions))
cols := make([]string, 0, 2)
if isPrivate.Has() {
repo.IsPrivate = isPrivate.Value()