revision traversal: --remove-empty fix.
Marco Costalba reports that --remove-empty omits the commit that created paths we are interested in. try_to_simplify_commit() logic was dropping a parent we introduced those paths against, which I think is not what we meant. Instead, this marks such parent uninteresting. The traversal does not go beyond that parent as advertised, but we still say that the current commit changed things from that parent. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Mar 12, 2006 at 13:39 UTC
a41e109c4bcd56537fc3801623b1aa0dd4e06f1c
1 file changed
+8
-3
revision.c
+8
-3
@@ -315,9 +315,14 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)
315
return;
316
317
case TREE_NEW:
318
- if (revs->remove_empty_trees && same_tree_as_empty(p->tree)) {
319
- *pp = parent->next;
320
- continue;
318
+ if (revs->remove_empty_trees &&
319
+ same_tree_as_empty(p->tree)) {
320
+ /* We are adding all the specified paths from
321
+ * this parent, so the parents of it is
322
+ * not interesting, but the difference between
323
+ * this parent and us still is interesting.
324
+ */
325
+ p->object.flags |= UNINTERESTING;
326
}
327
/* fallthrough */
328
case TREE_DIFFERENT: