Skip to content

Commit

Permalink
Merge branch 'stable' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
joshaber committed Feb 10, 2016
2 parents 1b416c7 + 88524b1 commit d759eb0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "1.6.0-beta0",
"version": "1.6.0-beta1",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
Expand All @@ -28,7 +28,7 @@
"fs-plus": "^2.8.0",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^4.1.0",
"git-utils": "^4.1.2",
"grim": "1.5.0",
"jasmine-json": "~0.0",
"jasmine-tagged": "^1.1.4",
Expand Down
30 changes: 29 additions & 1 deletion spec/git-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe "GitRepository", ->
expect(repo.isStatusModified(repo.getDirectoryStatus(directoryPath))).toBe true

describe ".refreshStatus()", ->
[newPath, modifiedPath, cleanPath, originalModifiedPathText] = []
[newPath, modifiedPath, cleanPath, originalModifiedPathText, workingDirectory] = []

beforeEach ->
workingDirectory = copyRepository()
Expand All @@ -231,6 +231,34 @@ describe "GitRepository", ->
expect(repo.isStatusNew(repo.getCachedPathStatus(newPath))).toBeTruthy()
expect(repo.isStatusModified(repo.getCachedPathStatus(modifiedPath))).toBeTruthy()

it 'caches the proper statuses when a subdir is open', ->
subDir = path.join(workingDirectory, 'dir')
fs.mkdirSync(subDir)

filePath = path.join(subDir, 'b.txt')
fs.writeFileSync(filePath, '')

atom.project.setPaths([subDir])

waitsForPromise ->
atom.workspace.open('b.txt')

statusHandler = null
runs ->
repo = atom.project.getRepositories()[0]

statusHandler = jasmine.createSpy('statusHandler')
repo.onDidChangeStatuses statusHandler
repo.refreshStatus()

waitsFor ->
statusHandler.callCount > 0

runs ->
status = repo.getCachedPathStatus(filePath)
expect(repo.isStatusModified(status)).toBe false
expect(repo.isStatusNew(status)).toBe false

describe "buffer events", ->
[editor] = []

Expand Down
1 change: 1 addition & 0 deletions src/git-repository.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ class GitRepository
relativeProjectPaths = @project?.getPaths()
.map (path) => @relativize(path)
.filter (path) -> path.length > 0
.map (path) -> path + '/**'

@statusTask?.terminate()
@statusTask = Task.once @handlerPath, @getPath(), relativeProjectPaths, ({statuses, upstream, branch, submodules}) =>
Expand Down

0 comments on commit d759eb0

Please sign in to comment.