Variable expansion in repository templates (#9163)
* Start expansion Signed-off-by: jolheiser <[email protected]> * _template rather than .template Signed-off-by: jolheiser <[email protected]> * Use ioutil Signed-off-by: jolheiser <[email protected]> * Add descriptions to mapping * Start globbing Signed-off-by: jolheiser <[email protected]> * Tune globbing Signed-off-by: jolheiser <[email protected]> * Re-arrange imports Signed-off-by: jolheiser <[email protected]> * Don't expand git hooks Signed-off-by: jolheiser <[email protected]> * Add glob tests for .giteatemplate Signed-off-by: jolheiser <[email protected]> * Parse globs separately so they can be tested more easily Signed-off-by: jolheiser <[email protected]> * Change template location and add docs Signed-off-by: jolheiser <[email protected]> * nit Signed-off-by: jolheiser <[email protected]> * Update docs/content/doc/features/gitea-directory.md Co-Authored-By: guillep2k <[email protected]> * Update docs/content/doc/features/gitea-directory.md Co-Authored-By: guillep2k <[email protected]> * Add upper-lower case match Signed-off-by: jolheiser <[email protected]> * Nits Signed-off-by: jolheiser <[email protected]> * Update models/repo_generate.go Co-Authored-By: guillep2k <[email protected]>
This commit is contained in:
committed by
techknowlogick
co-authored by
guillep2k
parent
c9d50bcab5
commit
15a5c10d33
@@ -161,6 +161,7 @@ type CloneRepoOptions struct {
|
||||
Branch string
|
||||
Shared bool
|
||||
NoCheckout bool
|
||||
Depth int
|
||||
}
|
||||
|
||||
// Clone clones original repository to target path.
|
||||
@@ -193,6 +194,9 @@ func CloneWithArgs(from, to string, args []string, opts CloneRepoOptions) (err e
|
||||
if opts.NoCheckout {
|
||||
cmd.AddArguments("--no-checkout")
|
||||
}
|
||||
if opts.Depth > 0 {
|
||||
cmd.AddArguments("--depth", strconv.Itoa(opts.Depth))
|
||||
}
|
||||
|
||||
if len(opts.Branch) > 0 {
|
||||
cmd.AddArguments("-b", opts.Branch)
|
||||
|
||||
Reference in New Issue
Block a user