filter-repo: fix pruning of former merge commits that have become empty

If a commit was a merge in the original repo, and its ancestors on at
least one side have all been filtered away, and the commit has no
filechanges relative to its remaining parent (if any), then this commit
should be pruned.  We had a small logic error preventing such pruning;
fix it by checking len(parents) instead of len(orig_parents).

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2019-05-11 12:09:06 -07:00
parent 6a6d21aff5
commit 3961a82ba4

View File

@ -1308,7 +1308,7 @@ class FastExportFilter(object):
if len(parents) >= 2 and not new_1st_parent:
return False
if len(orig_parents) < 2:
if len(parents) < 2:
# Special logic for commits that started empty...
if not had_file_changes:
had_parents_pruned = (len(parents) < len(orig_parents) or