summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-08-11 13:27:00 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-08-11 13:27:01 -0700
commit3ab01ac3f7681a294a09b42b9b014dc48a9aee22 (patch)
tree89d29b3f793d535a2a8c65c52b595bd0edb41daf /builtin/log.c
parentMerge branch 'ls/filter-process-delayed' (diff)
parentreflog-walk: apply --since/--until to reflog dates (diff)
downloadtgif-3ab01ac3f7681a294a09b42b9b014dc48a9aee22.tar.xz
Merge branch 'jk/reflog-walk'
Numerous bugs in walking of reflogs via "log -g" and friends have been fixed. * jk/reflog-walk: reflog-walk: apply --since/--until to reflog dates reflog-walk: stop using fake parents rev-list: check reflog_info before showing usage get_revision_1(): replace do-while with an early return log: do not free parents when walking reflog log: clarify comment about reflog cycles revision: disallow reflog walking with revs->limited t1414: document some reflog-walk oddities
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/log.c b/builtin/log.c
index cb7e0e61d7..725c7b8a1a 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -372,11 +372,14 @@ 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);
+ commit->parents = NULL;
}
- free_commit_list(commit->parents);
- commit->parents = NULL;
if (saved_nrl < rev->diffopt.needed_rename_limit)
saved_nrl = rev->diffopt.needed_rename_limit;
if (rev->diffopt.degraded_cc_to_c)