 
   # Public: Returns the number of commits behind the current branch is from the
   # its upstream remote branch.
-  getAheadBehindCount: (reference) -> @getRepo().getAheadBehindCount(reference)
+  #
+  # reference - The {String} branch reference name.
+  # path      - The {String} path in the repository to get ahead/behind branch
+  #             information for. Only needed if the repository contains
+  #             submodules.
+  getAheadBehindCount: (reference, path) ->
+    @getRepo(path).getAheadBehindCount(reference)
 
   # Public: Returns true if the given branch exists.
   hasBranch: (branch) -> @getReferenceTarget("refs/heads/#{branch}")?

  # Public: Returns the upstream branch for the current HEAD, or null if there
  # is no upstream branch for the current HEAD.
  #
  # Returns a {String} branch name such as `refs/remotes/origin/master`.
  getUpstreamBranch: -> @getRepo().getUpstreamBranch()

  # Public: Returns the current SHA for the given reference.
  getReferenceTarget: (reference) -> @getRepo().getReferenceTarget(reference)

  # Public: Gets all the local and remote references.

# This class shouldn't be instantiated directly but instead by accessing the
# `atom.project` global and calling `getRepo()`. Note that this will only be
# available when the project is backed by a Git repository.
#
# This class handles submodules automically by taking a `path` argument to many
# of the methods.  This `path` argument will determine which underlying
# repository is used.
#
# For a repository with submodules this would have the following outcome:
#
# ```coffee
# repo = atom.project.getRepo()
# repo.getShortHead() # 'master'
# repo.getShortHead('vendor/path/to/a/submodule') # 'dead1234'
# ```
#
# ## Example
#
