mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Test .isSubmodule.
This commit is contained in:
parent
d2d5966ee1
commit
92839a1f4f
@ -568,6 +568,23 @@ describe('GitRepositoryAsync', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('.isSubmodule(path)', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copySubmoduleRepository()
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
it("returns false for a path that isn't a submodule", async () => {
|
||||
const isSubmodule = await repo.isSubmodule('README')
|
||||
expect(isSubmodule).toBe(false)
|
||||
})
|
||||
|
||||
it('returns true for a path that is a submodule', async () => {
|
||||
const isSubmodule = await repo.isSubmodule('jstips')
|
||||
expect(isSubmodule).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getAheadBehindCount(reference, path)', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copyRepository()
|
||||
|
@ -252,8 +252,6 @@ export default class GitRepositoryAsync {
|
||||
.then(repo => repo.openIndex())
|
||||
.then(index => Promise.all([index, this.relativizeToWorkingDirectory(_path)]))
|
||||
.then(([index, relativePath]) => {
|
||||
// TODO: This'll probably be wrong if the submodule doesn't exist in the
|
||||
// index yet? Is that a thing?
|
||||
const entry = index.getByPath(relativePath)
|
||||
if (!entry) return false
|
||||
|
||||
@ -894,8 +892,6 @@ export default class GitRepositoryAsync {
|
||||
//
|
||||
// Returns a {Promise} which will resolve to {null} when refresh is complete.
|
||||
refreshStatus () {
|
||||
// TODO add submodule tracking
|
||||
|
||||
const status = this._refreshStatus()
|
||||
const branch = this._refreshBranch()
|
||||
const aheadBehind = branch.then(branchName => this._refreshAheadBehindCount(branchName))
|
||||
|
Loading…
Reference in New Issue
Block a user