     @unsubscribe()
 
   # Returns the corresponding {Repository}
-  getRepo: ->
+  getRepo: (path) ->
     unless @repo?
       throw new Error("Repository has been destroyed")
-    @repo
+
+    @repo.submoduleForPath(path) ? @repo
 
   # Reread the index to update any values that have changed since the
   # last time the index was read.

  # {::isStatusModified} or {::isStatusNew} to get more information.
  getPathStatus: (path) ->
    currentPathStatus = @statuses[path] ? 0
    pathStatus = @getRepo().getStatus(@relativize(path)) ? 0
    if pathStatus > 0
      @statuses[path] = pathStatus
    else

  #
  # Returns a {Boolean} that's true if the method was successful.
  checkoutHead: (path) ->
    repo = @getRepo(path)
    headCheckedOut = repo.checkoutHead(repo.relativize(path))
    @getPathStatus(path) if headCheckedOut
    headCheckedOut

