aboutsummaryrefslogtreecommitdiff
path: root/refstore/files
diff options
context:
space:
mode:
Diffstat (limited to 'refstore/files')
-rw-r--r--refstore/files/close.go13
-rw-r--r--refstore/files/store.go3
2 files changed, 7 insertions, 9 deletions
diff --git a/refstore/files/close.go b/refstore/files/close.go
index 37dde9b9..6dfe3668 100644
--- a/refstore/files/close.go
+++ b/refstore/files/close.go
@@ -1,13 +1,10 @@
package files
// Close releases resources associated with the store.
+//
+// Store borrows gitRoot, so Close does not close it.
+//
+// Repeated calls to Close are undefined behavior.
func (store *Store) Close() error {
- err := store.gitRoot.Close()
- commonErr := store.commonRoot.Close()
-
- if err != nil {
- return err
- }
-
- return commonErr
+ return store.commonRoot.Close()
}
diff --git a/refstore/files/store.go b/refstore/files/store.go
index 6091c000..378c0af0 100644
--- a/refstore/files/store.go
+++ b/refstore/files/store.go
@@ -14,7 +14,8 @@ import (
// Store reads and writes one Git files ref namespace rooted at one repository
// gitdir plus its commondir.
//
-// Store owns both roots and closes them in Close.
+// Store borrows gitRoot and owns commonRoot. Close releases only resources
+// opened by the store itself.
type Store struct {
gitRoot *os.Root
commonRoot *os.Root