aboutsummaryrefslogtreecommitdiffstats
path: root/worktree.go
diff options
context:
space:
mode:
Diffstat (limited to 'worktree.go')
-rw-r--r--worktree.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/worktree.go b/worktree.go
index e0f5fdf..13b2497 100644
--- a/worktree.go
+++ b/worktree.go
@@ -496,6 +496,10 @@ func (w *Worktree) Submodules() (Submodules, error) {
}
c, err := w.r.Config()
+ if err != nil {
+ return nil, err
+ }
+
for _, s := range m.Submodules {
l = append(l, w.newSubmodule(s, c.Submodules[s.Name]))
}
@@ -527,6 +531,7 @@ func (w *Worktree) readGitmodulesFile() (*config.Modules, error) {
return nil, err
}
+ defer f.Close()
input, err := stdioutil.ReadAll(f)
if err != nil {
return nil, err