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:
wxiaoguang authored and GitHub committed 2024-10-12 05:42:10 +00:00
1 parent 900ac62251
commit afa8dd45af
7 files changed
+149 -44

No files matched your search

+1 -1
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()