Skip to content

Commit fa99ca5

Browse files
christian-schillingLMG
authored andcommitted
Include case of direct parent
`repo.graph_descendant_of(a, b)` does return `false` if `a == b`, so that case needs to be handled extra.
1 parent d39a4d0 commit fa99ca5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/history.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,10 @@ pub fn unapply_filter(
340340
parent_count => {
341341
let mut tid = git2::Oid::zero();
342342
for i in 0..parent_count {
343-
if transaction
344-
.repo()
345-
.graph_descendant_of(original_parents_refs[i].id(), original_target)?
343+
if (original_parents_refs[i].id() == original_target)
344+
|| transaction
345+
.repo()
346+
.graph_descendant_of(original_parents_refs[i].id(), original_target)?
346347
{
347348
tid = new_trees[i];
348349
break;

0 commit comments

Comments
 (0)