 
   # Get the number of "added" files
   # Added is defined as new files that are staged
-  @register 'added',
+  register 'added',
     update: (done) ->
       git._status (err, statuses) ->
         statuses = _filter_statuses_by_desc statuses, 'added'

    STATUS_CODE_MAP[status.code]?.desc is desc


module.exports = (Impromptu, git) ->
  # Expose the repo object from the git-utils library
  # This will be null when we're not in a repo
  @register '_repo',
    update: (done) ->
      done null, repo

  # Helper to figure out if we're in a repo at all
  @register 'isRepo',
    update: (done) ->
      done null, !! repo

  # Root path to the repository
  @register 'root',
    update: (done) ->
      root = repo?.getPath().replace /\.git\/$/, ''
      done null, root

  # Each has a count of commits that your repo is ahead/behind its upstream
  #
  # This command *must* be passed through a formatter before its displayed
  register '_aheadBehind',
    update: (done) ->
      done null, repo?.getAheadBehindCount()

  # Get the number of commits you're ahead of the remote
  register 'ahead',
    update: (done) ->
      git._aheadBehind (err, aheadBehind) ->
        done err, aheadBehind?.ahead

  # Get the number of commits you're behind the remote
  register 'behind',
    update: (done) ->
      git._aheadBehind (err, aheadBehind) ->
        done err, aheadBehind?.behind
