LevelDB is no longer "the" datastore, adjust identifiers
Tommi Virtanen committed
Mar 16, 2015 at 13:49 UTC
5cb8d80bb6ac0f0ae150c61c2de9c19c680fd015
1 file changed
+6
-6
repo/fsrepo/fsrepo.go
+6
-6
@@ -25,7 +25,7 @@ import (
25
)
26
27
const (
28
- defaultDataStoreDirectory = "datastore"
28
+ leveldbDirectory = "datastore"
29
)
30
31
var (
@@ -190,8 +190,8 @@ func Init(repoPath string, conf *config.Config) error {
190
191
// The actual datastore contents are initialized lazily when Opened.
192
// During Init, we merely check that the directory is writeable.
193
- p := path.Join(repoPath, defaultDataStoreDirectory)
194
- if err := dir.Writable(p); err != nil {
193
+ leveldbPath := path.Join(repoPath, leveldbDirectory)
194
+ if err := dir.Writable(leveldbPath); err != nil {
195
return fmt.Errorf("datastore: %s", err)
196
}
197
@@ -236,8 +236,8 @@ func (r *FSRepo) openConfig() error {
236
237
// openDatastore returns an error if the config file is not present.
238
func (r *FSRepo) openDatastore() error {
239
- dsPath := path.Join(r.path, defaultDataStoreDirectory)
240
- ds, err := levelds.NewDatastore(dsPath, &levelds.Options{
239
+ leveldbPath := path.Join(r.path, leveldbDirectory)
240
+ ds, err := levelds.NewDatastore(leveldbPath, &levelds.Options{
241
Compression: ldbopts.NoCompression,
242
})
243
if err != nil {
@@ -430,7 +430,7 @@ func isInitializedUnsynced(repoPath string) bool {
430
if !configIsInitialized(repoPath) {
431
return false
432
}
433
- if !util.FileExists(path.Join(repoPath, defaultDataStoreDirectory)) {
433
+ if !util.FileExists(path.Join(repoPath, leveldbDirectory)) {
434
return false
435
}
436
return true