mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Get path status after checkout
This commit is contained in:
@@ -195,17 +195,25 @@ describe "GitRepositoryAsync", ->
|
||||
runs ->
|
||||
expect(fs.readFileSync(filePath, 'utf8')).toBe ''
|
||||
|
||||
xit "fires a status-changed event if the checkout completes successfully", ->
|
||||
it "fires a did-change-status event if the checkout completes successfully", ->
|
||||
fs.writeFileSync(filePath, 'ch ch changes')
|
||||
repo.getPathStatus(filePath)
|
||||
statusHandler = jasmine.createSpy('statusHandler')
|
||||
repo.onDidChangeStatus statusHandler
|
||||
repo.checkoutHead(filePath)
|
||||
expect(statusHandler.callCount).toBe 1
|
||||
expect(statusHandler.argsForCall[0][0]).toEqual {path: filePath, pathStatus: 0}
|
||||
|
||||
repo.checkoutHead(filePath)
|
||||
expect(statusHandler.callCount).toBe 1
|
||||
waitsForPromise ->
|
||||
repo.getPathStatus(filePath)
|
||||
runs ->
|
||||
repo.onDidChangeStatus statusHandler
|
||||
|
||||
waitsForPromise ->
|
||||
repo.checkoutHead(filePath)
|
||||
runs ->
|
||||
expect(statusHandler.callCount).toBe 1
|
||||
expect(statusHandler.argsForCall[0][0]).toEqual {path: filePath, pathStatus: 0}
|
||||
|
||||
waitsForPromise ->
|
||||
repo.checkoutHead(filePath)
|
||||
runs ->
|
||||
expect(statusHandler.callCount).toBe 1
|
||||
|
||||
xdescribe ".checkoutHeadForEditor(editor)", ->
|
||||
[filePath, editor] = []
|
||||
|
||||
@@ -84,6 +84,8 @@ module.exports = class GitRepositoryAsync {
|
||||
checkoutOptions.paths = [this._gitUtilsRepo.relativize(_path)]
|
||||
checkoutOptions.checkoutStrategy = Git.Checkout.STRATEGY.FORCE | Git.Checkout.STRATEGY.DISABLE_PATHSPEC_MATCH
|
||||
return Git.Checkout.head(repo, checkoutOptions)
|
||||
}).then(() => {
|
||||
return this.getPathStatus(_path)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user