From: Johannes Schindelin Date: Thu, 11 Jan 2007 10:57:13 GMT Subject: Re: [PATCH] Teach the revision walker to walk by reflogs with --walk-reflogs Message-ID: In-Reply-To: ... and an --amend: --- reflog-walk.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reflog-walk.c b/reflog-walk.c index 658cba9..d4b49c7 100644 --- a/reflog-walk.c +++ b/reflog-walk.c @@ -203,14 +203,16 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit) reflog = &commit_reflog->reflogs->items[commit_reflog->recno]; info->last_commit_reflog = commit_reflog; + commit_reflog->recno--; commit_info->commit = (struct commit *)parse_object(reflog->osha1); - if (!commit_info->commit) + if (!commit_info->commit) { + commit->parents = NULL; return; + } commit->parents = xcalloc(sizeof(struct commit_list), 1); commit->parents->item = commit_info->commit; commit->object.flags &= ~(ADDED | SEEN | SHOWN); - commit_reflog->recno--; } void show_reflog_message(struct reflog_walk_info* info)