filter-repo: fix comparison for commits that start empty

Due to the special handling of 'from' in the fast_export stream and the
aggregation of the 'from' commit with the 'merge'd commits, a parentless
commit has its parents represented as [None] rather than [].  We had
fixed this up in other places, but forgot to do so with orig_parents,
breaking our comparison.  Handle it for orig_parents too.

Signed-off-by: Elijah Newren <newren@gmail.com>
pull/13/head
Elijah Newren 5 years ago
parent 6507bea29a
commit 12dc7c9781

@ -1237,6 +1237,8 @@ class FastExportFilter(object):
if len(parents) < 2:
# Special logic for commits that started empty...
if not had_file_changes:
if orig_parents == [None]:
orig_parents = []
# If the commit remains empty and had parents pruned, then prune
# this commit; otherwise, retain it
return (not commit.file_changes and

Loading…
Cancel
Save