From e40b3168565df42ea612a0cf613c89b51b2745e0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 19 Feb 2026 12:12:01 -0800 Subject: [PATCH] improvement --- modules/structs/repo.go | 4 ++-- services/forms/repo_form.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 25918ce0d4..c0ca75455a 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -151,9 +151,9 @@ type CreateRepoOption struct { // TrustModel of the repository // enum: default,collaborator,committer,collaboratorcommitter TrustModel string `json:"trust_model" binding:"In(default,collaborator,committer,collaboratorcommitter)"` - // ObjectFormatName of the underlying git repository + // ObjectFormatName of the underlying git repository, empty string for default (sha1) // enum: sha1,sha256 - ObjectFormatName string `json:"object_format_name" binding:"MaxSize(6) In(sha1,sha256)"` + ObjectFormatName string `json:"object_format_name" binding:"MaxSize(6)"` } // EditRepoOption options when editing a repository's properties diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index bfd7eb96b5..6dff83f4d2 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -42,7 +42,7 @@ type CreateRepoForm struct { ProtectedBranch bool ForkSingleBranch string `binding:"MaxSize(255)"` - ObjectFormatName string `binding:"MaxSize(6) In(sha1,sha256)"` + ObjectFormatName string `binding:"In(sha1,sha256)"` } // Validate validates the fields