1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-20 21:36:13 +02:00

log: clarify comment about reflog cycles

When we're walking reflogs, we leave the commit buffer and
parents in place. A comment explains that this is due to
"cycles". But the interesting thing is the unsaid
implication: that the cycles (plus our clearing of the SEEN
flag) will cause us to show commits multiple times. Let's
spell it out.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2017-07-09 06:13:51 -04:00 committed by Junio C Hamano
parent 82fd0f4a4b
commit 822601e830

View File

@ -372,7 +372,10 @@ static int cmd_log_walk(struct rev_info *rev)
*/
rev->max_count++;
if (!rev->reflog_info) {
/* we allow cycles in reflog ancestry */
/*
* We may show a given commit multiple times when
* walking the reflogs.
*/
free_commit_buffer(commit);
}
free_commit_list(commit->parents);