diff --git a/git-filter-repo b/git-filter-repo index ce8eee8..452cf72 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -3025,8 +3025,6 @@ class RepoFilter(object): Returns a tuple: (parents, new_first_parent_if_would_become_non_merge)''' - if self._args.prune_degenerate == 'never': - return parents, None always_prune = (self._args.prune_degenerate == 'always') # Pruning of empty commits means multiple things: @@ -3051,6 +3049,10 @@ class RepoFilter(object): if len(parents) < 2: return parents, None + # Don't remove redundant parents if user doesn't want us to + if self._args.prune_degenerate == 'never': + return parents, None + # Remove duplicate parents (if both sides of history have lots of commits # which become empty due to pruning, the most recent ancestor on both # sides may be the same commit), except only remove parents that have