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.

20 lines
575 B

  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. "github.com/go-macaron/binding"
  7. macaron "gopkg.in/macaron.v1"
  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. }