summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-07-09 06:13:51 -0400
committerJunio C Hamano <gitster@pobox.com>2017-07-09 10:00:05 -0700
commit822601e8303270aebed493b11e0988a75f2646b8 (patch)
treeeaca450db93d497a5a0609c5ddf3f045e4710520
parent82fd0f4a4b2c394ddba279eab7072fe87b750d2e (diff)
downloadgit-822601e8303270aebed493b11e0988a75f2646b8.tar.gz
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>
-rw-r--r--builtin/log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 8ca1de9894..cf303b2c06 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -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);