       expect(-> repo.getShortHead()).toThrow()
 
   describe ".getPathStatus(path)", ->
-    [filePath, originalPathText] = []
-
-    beforeEach ->
-      repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
-      filePath = require.resolve('./fixtures/git/working-dir/file.txt')
-      originalPathText = fs.readFileSync(filePath, 'utf8')
-
-    afterEach ->
-      fs.writeFileSync(filePath, originalPathText)
+    [filePath] = []
+
+    beforeEach ->
+      workingDirectory = copyRepository()
+      repo = new Git(workingDirectory)
+      filePath = path.join(workingDirectory, 'file.txt')
 
     it "trigger a status-changed event when the new status differs from the last cached one", ->
       statusHandler = jasmine.createSpy("statusHandler")

      expect(statusHandler.callCount).toBe 1

  describe ".getDirectoryStatus(path)", ->
    [directoryPath, filePath, originalPathText] = []

    beforeEach ->
      repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
      directoryPath = path.join(__dirname, 'fixtures', 'git', 'working-dir', 'dir')
      filePath = require.resolve('./fixtures/git/working-dir/dir/b.txt')
      originalPathText = fs.readFileSync(filePath, 'utf8')

    afterEach ->
      fs.writeFileSync(filePath, originalPathText)

    it "gets the status based on the files inside the directory", ->
      expect(repo.isStatusModified(repo.getDirectoryStatus(directoryPath))).toBe false

    [newPath, modifiedPath, cleanPath, originalModifiedPathText] = []

    beforeEach ->
      workingDirectory = copyRepository()
      repo = new Git(workingDirectory)
      modifiedPath = path.join(workingDirectory, 'file.txt')
      newPath = path.join(workingDirectory, 'untracked.txt')
      cleanPath = path.join(workingDirectory, 'other.txt')
      fs.writeFileSync(cleanPath, 'Full of text')
      fs.writeFileSync(newPath, '')
      newPath = fs.absolute newPath  # specs could be running under symbol path.

    it "returns status information for all new and modified files", ->
      fs.writeFileSync(modifiedPath, 'making this path modified')
