diff options
Diffstat (limited to 'modules/git/repo.go')
-rw-r--r-- | modules/git/repo.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go index 6368c6459b..5636405118 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -101,6 +101,7 @@ type CloneRepoOptions struct { Shared bool NoCheckout bool Depth int + Filter string } // Clone clones original repository to target path. @@ -136,7 +137,9 @@ func CloneWithArgs(ctx context.Context, from, to string, args []string, opts Clo if opts.Depth > 0 { cmd.AddArguments("--depth", strconv.Itoa(opts.Depth)) } - + if opts.Filter != "" { + cmd.AddArguments("--filter", opts.Filter) + } if len(opts.Branch) > 0 { cmd.AddArguments("-b", opts.Branch) } |