*
* Sets the return value to STOP if no further output should be generated.
*/
-static int emit_stack(struct commit_list **stack, emitter_func emitter)
+static int emit_stack(struct commit_list **stack, emitter_func emitter, int include_last)
{
unsigned int seen = 0;
int action = CONTINUE;
while (*stack && (action != STOP)) {
struct commit *next = pop_commit(stack);
seen |= next->object.flags;
- if (*stack)
+ if (*stack || include_last) {
+ if (!*stack)
+ next->object.flags |= BOUNDARY;
action = (*emitter) (next);
+ }
}
if (*stack) {
} else {
struct commit_list *stack = NULL;
sort_first_epoch(next, &stack);
- action = emit_stack(&stack, emitter);
+ action = emit_stack(&stack, emitter, (base == NULL));
next = base;
}
}
}
}
- action = emit_stack(&stack, emitter);
+ action = emit_stack(&stack, emitter, (base==NULL));
}
if (base && (action != STOP)) {