Files
Gitea/services/forms/repo_branch_form.go
T
wxiaoguang 72a9debaff refactor: clean up form binding & validation (#38873)
Clarify the "validation" and "error display" logic.

All the copied&pasted `Validate` functions are removed.
2026-08-14 02:15:33 +00:00

22 lines
597 B
Go

// Copyright 2017 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forms
import "gitea.dev/modules/web/middleware"
// NewBranchForm form for creating a new branch
type NewBranchForm struct {
middleware.FormDefaultValidator
NewBranchName string `binding:"Required;MaxSize(100);GitRefName"`
CurrentPath string
CreateTag bool
}
// RenameBranchForm form for rename a branch
type RenameBranchForm struct {
middleware.FormDefaultValidator
From string `binding:"Required;MaxSize(100);GitRefName"`
To string `binding:"Required;MaxSize(100);GitRefName"`
}