commands/clone,git: support '--shallow-submodules'
This commit is contained in:
parent
aabbc22737
commit
d805f0b7db
@ -151,6 +151,7 @@ func init() {
|
||||
cmd.Flags().BoolVarP(&cloneFlags.Ipv6, "ipv6", "", false, "See 'git clone --help'")
|
||||
cmd.Flags().StringVarP(&cloneFlags.ShallowSince, "shallow-since", "", "", "See 'git clone --help'")
|
||||
cmd.Flags().StringVarP(&cloneFlags.ShallowExclude, "shallow-exclude", "", "", "See 'git clone --help'")
|
||||
cmd.Flags().BoolVarP(&cloneFlags.ShallowSubmodules, "shallow-submodules", "", false, "See 'git clone --help'")
|
||||
|
||||
cmd.Flags().StringVarP(&includeArg, "include", "I", "", "Include a list of paths")
|
||||
cmd.Flags().StringVarP(&excludeArg, "exclude", "X", "", "Exclude a list of paths")
|
||||
|
@ -804,6 +804,8 @@ type CloneFlags struct {
|
||||
ShallowSince string
|
||||
// --shallow-since <date>
|
||||
ShallowExclude string
|
||||
// --shallow-submodules
|
||||
ShallowSubmodules bool
|
||||
}
|
||||
|
||||
// CloneWithoutFilters clones a git repo but without the smudge filter enabled
|
||||
@ -912,6 +914,9 @@ func CloneWithoutFilters(flags CloneFlags, args []string) error {
|
||||
if len(flags.ShallowExclude) > 0 {
|
||||
cmdargs = append(cmdargs, "--shallow-exclude", flags.ShallowExclude)
|
||||
}
|
||||
if flags.ShallowSubmodules {
|
||||
cmdargs = append(cmdargs, "--shallow-submodules")
|
||||
}
|
||||
|
||||
// Now args
|
||||
cmdargs = append(cmdargs, args...)
|
||||
|
Loading…
Reference in New Issue
Block a user