From 6497d1e843cbaec2b86cd5a284bd95c693e55cc0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 1 Oct 2016 22:50:07 -0400 Subject: BF: Allow to remove a submodule with a remote without refs --- git/objects/submodule/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1