You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

repo_branch_form.go 569B

1234567891011121314151617181920
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package auth
  5. import (
  6. "gitea.com/macaron/binding"
  7. "gitea.com/macaron/macaron"
  8. )
  9. // NewBranchForm form for creating a new branch
  10. type NewBranchForm struct {
  11. NewBranchName string `binding:"Required;MaxSize(100);GitRefName"`
  12. }
  13. // Validate validates the fields
  14. func (f *NewBranchForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  15. return validate(errs, ctx.Data, f, ctx.Locale)
  16. }