     proc.process.on 'error', (err) ->
       handler(new GitNotFoundError, null)
 
-  @checkoutSide: (sideName, filepath, callback) ->
-    return unless @_checkHealth(callback, filepath)
+  @checkoutSide: (repo, sideName, filepath, callback) ->
+    return unless @_checkHealth(callback)
 
     proc = @process({
       command: GitCmd,
       args: ['checkout', "--#{sideName}", filepath],
-      options: { cwd: @_repoWorkDir() },
+      options: { cwd: repo.getWorkingDirectory() },
       stdout: (line) -> console.log line
       stderr: (line) -> console.log line
       exit: (code) ->

    proc = @process({
      command: GitCmd,
      args: ['status', '--porcelain', filepath],
      options: { cwd: @_repoWorkDir() },
      stdout: stdoutHandler,
      stderr: stderrHandler,
      exit: exitHandler

    proc.process.on 'error', (err) ->
      handler(new GitNotFoundError(errMessage.join("\n")), null)

  @isStaged: (repo, filepath, handler) ->
    return unless @_checkHealth(handler)

    staged = true

