diff --git a/src/git.coffee b/src/git.coffee index 607b87450..cbaef9195 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -102,11 +102,11 @@ class Git # Returns the corresponding {Repository} getRepo: (path) -> - unless @repo? + if @repo? + @repo.submoduleForPath(path) ? @repo + else throw new Error("Repository has been destroyed") - @repo.submoduleForPath(path) ? @repo - # Reread the index to update any values that have changed since the # last time the index was read. refreshIndex: -> @getRepo().refreshIndex()