提交 006f424b 编写于 作者: J Junio C Hamano

Merge branch 'jk/maint-reflog-bottom' into maint

* jk/maint-reflog-bottom:
  reflogs: clear flags properly in corner case
......@@ -239,7 +239,6 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit)
commit->parents = xcalloc(sizeof(struct commit_list), 1);
commit->parents->item = commit_info->commit;
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
}
void get_reflog_selector(struct strbuf *sb,
......
......@@ -2030,8 +2030,10 @@ static struct commit *get_revision_1(struct rev_info *revs)
revs->commits = entry->next;
free(entry);
if (revs->reflog_info)
if (revs->reflog_info) {
fake_reflog_parent(revs->reflog_info, commit);
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
}
/*
* If we haven't done the list limiting, we need to look at
......
#!/bin/sh
test_description='reflog walk shows repeated commits again'
. ./test-lib.sh
test_expect_success 'setup commits' '
test_tick &&
echo content >file && git add file && git commit -m one &&
git tag one &&
echo content >>file && git add file && git commit -m two &&
git tag two
'
test_expect_success 'setup reflog with alternating commits' '
git checkout -b topic &&
git reset one &&
git reset two &&
git reset one &&
git reset two
'
test_expect_success 'reflog shows all entries' '
cat >expect <<-\EOF
topic@{0} two: updating HEAD
topic@{1} one: updating HEAD
topic@{2} two: updating HEAD
topic@{3} one: updating HEAD
topic@{4} branch: Created from HEAD
EOF
git log -g --format="%gd %gs" topic >actual &&
test_cmp expect actual
'
test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册