1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-06 03:16:10 +02:00

Merge branch 'jk/maint-reflog-bottom'

* jk/maint-reflog-bottom:
  reflogs: clear flags properly in corner case
This commit is contained in:
Junio C Hamano 2010-12-12 21:49:51 -08:00
commit 9f5074e034
3 changed files with 37 additions and 2 deletions

View File

@ -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,

View File

@ -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

34
t/t1412-reflog-loop.sh Executable file
View File

@ -0,0 +1,34 @@
#!/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