aboutsummaryrefslogtreecommitdiffstats
path: root/repository
diff options
context:
space:
mode:
Diffstat (limited to 'repository')
-rw-r--r--repository/gogit.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/repository/gogit.go b/repository/gogit.go
index 781eec73..b14efbe5 100644
--- a/repository/gogit.go
+++ b/repository/gogit.go
@@ -217,11 +217,12 @@ func isGitDir(path string) (bool, error) {
func (repo *GoGitRepo) Close() error {
var firstErr error
- for _, index := range repo.indexes {
+ for name, index := range repo.indexes {
err := index.Close()
if err != nil && firstErr == nil {
firstErr = err
}
+ delete(repo.indexes, name)
}
return firstErr
}