From 12dc7c9781758b6384ba0294e712daf025a25988 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 4 Mar 2019 13:40:58 -0800 Subject: [PATCH] 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 --- git-filter-repo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-filter-repo b/git-filter-repo index 4705783..e584f59 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -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