Skip to content

Commit 8f38027

Browse files
committed
fix: tweaks
1 parent 3be4cf9 commit 8f38027

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,11 @@ class IpfsRepo {
281281
autoMigrateConfig = await this.config.get(AUTO_MIGRATE_CONFIG_KEY)
282282
} catch (e) {
283283
if (e.code === ERRORS.NotFoundError.code) {
284-
autoMigrateConfig = true
284+
autoMigrateConfig = true // Config's default value is True
285285
} else {
286286
throw e
287287
}
288288
}
289-
log(`optin: ${this.options.autoMigrate}; config: ${autoMigrateConfig}`)
290289

291290
return autoMigrateConfig && this.options.autoMigrate
292291
}
@@ -298,10 +297,6 @@ class IpfsRepo {
298297
throw new ERRORS.InvalidRepoVersionError('Your repo\'s version is higher then this version of js-ipfs-repo require! You have to revert it.')
299298
}
300299

301-
if (currentRepoVersion === toVersion) {
302-
return
303-
}
304-
305300
log('migrating to version ' + toVersion)
306301
return migrator.migrate(this.path, { toVersion: toVersion, ignoreLock: true, repoOptions: this.options })
307302
}

test/browser.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ async function createTempRepo ({ dontOpen, opts }) {
1717

1818
return {
1919
path: repoPath,
20-
instance: repo,
21-
teardown: async () => {
22-
}
20+
instance: repo
2321
}
2422
}
2523

test/migrations-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const sinon = require('sinon')
1010

1111
const migrator = require('ipfs-repo-migrations')
1212
const constants = require('../src/constants')
13+
const config = require('../src/config')
1314
const errors = require('../src/errors')
1415
const IPFSRepo = require('../src')
1516

0 commit comments

Comments
 (0)