   isStatusModified: (status) ->
     @getRepo().isStatusModified(status)
 
-  # Public: Identifies if a path was modified.
+  # Identifies if a path was modified.
   #
   # path - The {String} path to check
   #

    @getPathStatus(path) if headCheckedOut
    headCheckedOut

  # Public: Retrieves the number of lines added and removed to a path.
  #
  # This compares the working directory contents of the path to the `HEAD` version.
  #

module.exports =
class Git

  statuses: null
  upstream: null
  statusTask: null

  ### Internal ###

  # Creates a new `Git` object.
  #
  # path - The {String} representing the path to your git working directory
  # options - A hash with the following keys:
  #           :refreshOnWindowFocus - If `true`, {#refreshIndex} and {#refreshStatus} are called on focus
  constructor: (path, options={}) ->
    @repo = GitUtils.open(path)
    unless @repo?
      throw new Error("No Git repository found searching path: #{path}")

    @statuses = {}
    @upstream = {ahead: 0, behind: 0}

    refreshOnWindowFocus = options.refreshOnWindowFocus ? true
    if refreshOnWindowFocus
      $ = require 'jquery'
      @subscribe $(window), 'focus', =>
        @refreshIndex()
        @refreshStatus()

    project?.eachBuffer this, (buffer) =>
      bufferStatusHandler = =>
        path = buffer.getPath()
        @getPathStatus(path) if path
      @subscribe buffer, 'saved', bufferStatusHandler
      @subscribe buffer, 'reloaded', bufferStatusHandler

  destroy: ->
    if @statusTask?
      @statusTask.abort()
      @statusTask.off()
      @statusTask = null

    if @repo?
      @repo.release()
      @repo = null

    @unsubscribe()

  ### Public ###

  # Creates a new `Git` instance.
  #
  # path - The git repository to open
  # options - A hash with one key:
