   changes: {}
 
   constructor: ->
-    @repoPromise = Git.Repository.open(atom.project.getPaths()[0])
+    @repoPath = atom.project.getPaths()[0]
+    @repoPromise = Git.Repository.open(@repoPath)
     @indexPromise = @repoPromise.then (repo) ->
       repo.openIndex()
 

      repo.getBranch('HEAD')

  getPatch: (path, state) ->
    console.log('getting', path, state)
    if state == 'unstaged'
      @unstagedPromise.then (diff) ->
        for patch in diff.patches()

Git = require 'nodegit'
ChildProcess = require 'child_process'

normalizeOptions = (options, Ctor) ->
  instance = (if options instanceof Ctor then options else new Ctor())
