aboutsummaryrefslogtreecommitdiffstats
path: root/worktree.go
diff options
context:
space:
mode:
authorDevon Barrett <devon@devonbarrett.net>2017-07-29 13:12:57 +0100
committerDevon Barrett <devon@devonbarrett.net>2017-07-29 13:12:57 +0100
commit63b30fba572b7e70833fae4785c6d22f167c6641 (patch)
tree282c7bc5b476ad21c4cbfad63c74b36d338cb5d1 /worktree.go
parent8ddbecf782c2e340fd85bb4ba4d00dc73d749f87 (diff)
downloadgo-git-63b30fba572b7e70833fae4785c6d22f167c6641.tar.gz
reuse Auth method when recursing submodules, fixes #521
Diffstat (limited to 'worktree.go')
-rw-r--r--worktree.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/worktree.go b/worktree.go
index 4e4d544..60c8adb 100644
--- a/worktree.go
+++ b/worktree.go
@@ -112,22 +112,22 @@ func (w *Worktree) PullContext(ctx context.Context, o *PullOptions) error {
}
if o.RecurseSubmodules != NoRecurseSubmodules {
- return w.updateSubmodules(o.RecurseSubmodules)
+ return w.updateSubmodules(&SubmoduleUpdateOptions{
+ RecurseSubmodules: o.RecurseSubmodules,
+ Auth: o.Auth,
+ })
}
return nil
}
-func (w *Worktree) updateSubmodules(recursion SubmoduleRescursivity) error {
+func (w *Worktree) updateSubmodules(o *SubmoduleUpdateOptions) error {
s, err := w.Submodules()
if err != nil {
return err
}
-
- return s.Update(&SubmoduleUpdateOptions{
- Init: true,
- RecurseSubmodules: recursion,
- })
+ o.Init = true
+ return s.Update(o)
}
// Checkout switch branches or restore working tree files.