mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 19:39:49 +02:00
rebase on master
This commit is contained in:
1 parent
0615b668dc
commit
bb96349d09
13 files changed
+99
-5
No files matched your search
@@ -48,6 +48,7 @@ type CreateRepoForm struct {
|
||||
Avatar bool
|
||||
Labels bool
|
||||
TrustModel string
|
||||
SizeLimit int64
|
||||
}
|
||||
|
||||
// Validate validates the fields
|
||||
@@ -126,6 +127,7 @@ type RepoSettingForm struct {
|
||||
Private bool
|
||||
Template bool
|
||||
EnablePrune bool
|
||||
RepoSizeLimit int64
|
||||
|
||||
// Advanced settings
|
||||
EnableWiki bool
|
||||
|
||||
+6
-1
@@ -352,8 +352,13 @@ const (
|
||||
|
||||
// CountObjects returns the results of git count-objects on the repoPath
|
||||
func CountObjects(repoPath string) (*CountObject, error) {
|
||||
return CountObjectsWithEnv(repoPath, nil)
|
||||
}
|
||||
|
||||
// CountObjectsWithEnv returns the results of git count-objects on the repoPath with custom env setup
|
||||
func CountObjectsWithEnv(repoPath string, env []string) (*CountObject, error) {
|
||||
cmd := NewCommand("count-objects", "-v")
|
||||
stdout, err := cmd.RunInDir(repoPath)
|
||||
stdout, err := cmd.RunInDirWithEnv(repoPath, env)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (*mod
|
||||
Status: opts.Status,
|
||||
IsEmpty: !opts.AutoInit,
|
||||
TrustModel: opts.TrustModel,
|
||||
SizeLimit: opts.SizeLimit,
|
||||
}
|
||||
|
||||
if err := models.WithTx(func(ctx models.DBContext) error {
|
||||
|
||||
@@ -122,6 +122,8 @@ type CreateRepoOption struct {
|
||||
// TrustModel of the repository
|
||||
// enum: default,collaborator,committer,collaboratorcommitter
|
||||
TrustModel string `json:"trust_model"`
|
||||
// SizeLimit of the repository
|
||||
SizeLimit int64 `json:"size_limit"`
|
||||
}
|
||||
|
||||
// EditRepoOption options when editing a repository's properties
|
||||
@@ -168,6 +170,8 @@ type EditRepoOption struct {
|
||||
AllowSquash *bool `json:"allow_squash_merge,omitempty"`
|
||||
// set to `true` to archive this repository.
|
||||
Archived *bool `json:"archived,omitempty"`
|
||||
// SizeLimit of the repository.
|
||||
SizeLimit *int64 `json:"size_limit,omitempty"`
|
||||
}
|
||||
|
||||
// CreateBranchRepoOption options when creating a branch in a repository
|
||||
|
||||
Reference in new issue
Block a user