mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 02:12:17 +02:00
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:
parent
6a6d21aff5
commit
3961a82ba4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user