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