summaryrefslogtreecommitdiff
path: root/git/diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/diff.py')
-rw-r--r--git/diff.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/git/diff.py b/git/diff.py
index a0076f0c..fcf40f2b 100644
--- a/git/diff.py
+++ b/git/diff.py
@@ -283,7 +283,8 @@ class Diff(object):
if repo and a_rawpath:
for submodule in repo.submodules:
if submodule.path == a_rawpath.decode("utf-8"):
- repo = submodule.module()
+ if submodule.module_exists():
+ repo = submodule.module()
break
if a_blob_id is None or a_blob_id == self.NULL_HEX_SHA: