mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Make project's Git repository a window global
This allows it to operate independently of the project and mirror the availability of the root view and project.
This commit is contained in:
@@ -8,6 +8,7 @@ $ = require 'jquery'
|
||||
{$$} = require 'space-pen'
|
||||
_ = require 'underscore'
|
||||
fs = require 'fs'
|
||||
Git = require 'git'
|
||||
|
||||
describe "Editor", ->
|
||||
[buffer, editor, cachedLineHeight] = []
|
||||
|
||||
@@ -14,6 +14,7 @@ Editor = require 'editor'
|
||||
TokenizedBuffer = require 'tokenized-buffer'
|
||||
fs = require 'fs'
|
||||
RootView = require 'root-view'
|
||||
Git = require 'git'
|
||||
requireStylesheet "jasmine.css"
|
||||
fixturePackagesPath = require.resolve('fixtures/packages')
|
||||
require.paths.unshift(fixturePackagesPath)
|
||||
@@ -31,6 +32,11 @@ beforeEach ->
|
||||
jQuery.fx.off = true
|
||||
window.fixturesProject = new Project(require.resolve('fixtures'))
|
||||
window.project = fixturesProject
|
||||
window.git = Git.open(fixturesProject.getPath())
|
||||
window.project.on 'path-changed', ->
|
||||
window.git?.destroy()
|
||||
window.git = Git.open(window.project.getPath())
|
||||
|
||||
window.resetTimeouts()
|
||||
atom.atomPackageStates = {}
|
||||
atom.loadedPackages = []
|
||||
@@ -72,6 +78,9 @@ afterEach ->
|
||||
if project?
|
||||
project.destroy()
|
||||
window.project = null
|
||||
if git?
|
||||
git.destroy()
|
||||
window.git = null
|
||||
$('#jasmine-content').empty()
|
||||
ensureNoPathSubscriptions()
|
||||
waits(0) # yield to ui thread to make screen update more frequently
|
||||
|
||||
Reference in New Issue
Block a user