aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/repository.go b/repository.go
index 6c3be2e..dd822a5 100644
--- a/repository.go
+++ b/repository.go
@@ -916,7 +916,13 @@ func (r *Repository) clone(ctx context.Context, o *CloneOptions) error {
if o.RecurseSubmodules != NoRecurseSubmodules {
if err := w.updateSubmodules(&SubmoduleUpdateOptions{
RecurseSubmodules: o.RecurseSubmodules,
- Auth: o.Auth,
+ Depth: func() int {
+ if o.ShallowSubmodules {
+ return 1
+ }
+ return 0
+ }(),
+ Auth: o.Auth,
}); err != nil {
return err
}