summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git/objects/submodule/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py
index c6c6d699..90f796bd 100644
--- a/git/objects/submodule/base.py
+++ b/git/objects/submodule/base.py
@@ -836,7 +836,7 @@ class Submodule(util.IndexObject, Iterable, Traversable):
num_branches_with_new_commits += len(mod.git.cherry(rref)) != 0
# END for each remote ref
# not a single remote branch contained all our commits
- if num_branches_with_new_commits == len(rrefs):
+ if len(rrefs) and num_branches_with_new_commits == len(rrefs):
raise InvalidGitRepositoryError(
"Cannot delete module at %s as there are new commits" % mod.working_tree_dir)
# END handle new commits