 Git = require 'nodegit'
+ChildProcess = require 'child_process'
 
 normalizeOptions = (options, Ctor) ->
   instance = (if options instanceof Ctor then options else new Ctor())

  changes: {}

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


      repo.getBranch('HEAD')

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