Commit 7b18e6d
committed
filter-repo: fix --prune-degenerate=never with path filtering
When combining `--prune-degenerate never` with a `--path` specification,
we could end up trying to write a parent out to the fast-import stream
whose value was actually None. The problem occurs when the parents of
a merge commit are filtered out by the path specification, leaving us
only with no-longer-extant parents. In such a case, we need to filter
out these 'None' (i.e. invalid) parents. The point of
`--prune-degenerate never` is to avoid removing parents that are either
the same as or an ancestor of another parent, not to avoid removing
non-existent parents. Remove the non-existent parent(s).
Reported-by: Gaurav Kanoongo (@gauravkanoongo on GitHub)
Signed-off-by: Elijah Newren <[email protected]>1 parent df6c865 commit 7b18e6d
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3025 | 3025 | | |
3026 | 3026 | | |
3027 | 3027 | | |
3028 | | - | |
3029 | | - | |
3030 | 3028 | | |
3031 | 3029 | | |
3032 | 3030 | | |
| |||
3051 | 3049 | | |
3052 | 3050 | | |
3053 | 3051 | | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
3054 | 3056 | | |
3055 | 3057 | | |
3056 | 3058 | | |
| |||
0 commit comments