Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-13 08:49:51 +0300
committerJunio C Hamano <gitster@pobox.com>2010-12-13 08:49:51 +0300
commit9f5074e0348071532911cffb622d7df6754a9743 (patch)
treefc7c2003d22ca48107e199175d857c2b32d69801
parent0d181cbb8adbc964a075fd71148415f6bd431272 (diff)
parentffa1eeaeea38f6d667e304f9b12c890b7c14d088 (diff)
Merge branch 'jk/maint-reflog-bottom'
* jk/maint-reflog-bottom: reflogs: clear flags properly in corner case
-rw-r--r--reflog-walk.c1
-rw-r--r--revision.c4
-rwxr-xr-xt/t1412-reflog-loop.sh34
3 files changed, 37 insertions, 2 deletions
diff --git a/reflog-walk.c b/reflog-walk.c
index 4879615cad..5d81d39a52 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -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,
diff --git a/revision.c b/revision.c
index b1c18906ba..ded881263b 100644
--- a/revision.c
+++ b/revision.c
@@ -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
diff --git a/t/t1412-reflog-loop.sh b/t/t1412-reflog-loop.sh
new file mode 100755
index 0000000000..7f519e5ebe
--- /dev/null
+++ b/t/t1412-reflog-loop.sh
@@ -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