   getPathStatus: (path) ->
     repo = @getRepo(path)
     relativePath = @relativize(path)
-    currentPathStatus = @statusesByPath[relativePath] ? @async.getCachedPathStatuses()[relativePath] ? 0
+
+    # This is a bit particular. If a package calls `getPathStatus` like this:
+    #  - change the file
+    #  - getPathStatus
+    #  - change the file
+    #  - getPathStatus
+    # We need to preserve the guarantee that each call to `getPathStatus` will
+    # synchronously emit 'did-change-status'. So we need to keep a cache of the
+    # statuses found from this call.
+    currentPathStatus = @getCachedRelativePathStatus(relativePath) ? 0
 
     # Trigger events emitted on the async repo as well
     @async.refreshStatusForPath(path)

  getDirectoryStatus: (directoryPath)  ->
    directoryPath = "#{@relativize(directoryPath)}/"
    directoryStatus = 0
    for path, status of @async.getCachedPathStatuses()
      directoryStatus |= status if path.indexOf(directoryPath) is 0
    directoryStatus


  #
  # Returns a status {Number} or null if the path is not in the cache.
  getCachedPathStatus: (path) ->
    relativePath = @relativize(path)
    @getCachedRelativePathStatus(relativePath)

  getCachedRelativePathStatus: (relativePath) ->
    @statusesByPath[relativePath] ? @async.getCachedPathStatuses()[relativePath]

  # Public: Returns true if the given status indicates modification.
  #
