diff options
author | tanaga9 <tanaga9@users.noreply.github.com> | 2019-10-27 01:49:59 +0900 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2019-10-28 09:02:06 +0100 |
commit | 553500a3447667aaa9bd3b922742575562c03b68 (patch) | |
tree | f1bbe3d577005f268b778fd36350cccb1794e3f8 /git/diff.py | |
parent | ebf46561837f579d202d7bd4a22362f24fb858a4 (diff) | |
download | gitpython-553500a3447667aaa9bd3b922742575562c03b68.tar.gz |
Check if submodule exists before referencing
Diffstat (limited to 'git/diff.py')
-rw-r--r-- | git/diff.py | 3 |
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: |