From 8e2856465cee4ceb389e29ed762530c7ef03cd61 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 20 Mar 2014 13:42:22 -0700 Subject: [PATCH] Handle submodules in getDiffStats/isSubmodule --- src/git.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/git.coffee b/src/git.coffee index ff3fa9815..941b577fa 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -212,14 +212,18 @@ class Git # Returns an {Object} with the following keys: # :added - The {Number} of added lines. # :deleted - The {Number} of deleted lines. - getDiffStats: (path) -> @getRepo().getDiffStats(@relativize(path)) + getDiffStats: (path) -> + repo = @getRepo(path) + repo.getDiffStats(repo.relativize(path)) # Public: Is the given path a submodule in the repository? # # path - The {String} path to check. # # Returns a {Boolean}. - isSubmodule: (path) -> @getRepo().isSubmodule(@relativize(path)) + isSubmodule: (path) -> + repo = @getRepo(path) + repo.isSubmodule(repo.relativize(path)) # Public: Get the status of a directory in the repository's working directory. #