aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorSverre Hvammen Johansen <hvammen+git@gmail.com>2008-07-13 08:13:55 +0000
committerJunio C Hamano <gitster@pobox.com>2008-07-13 13:53:54 -0700
commit3d1dd4728b83e4c08d9fa7aaf2aa946e1012e061 (patch)
treec16f233808218d861b069d481fc95265e2716c01 /commit.c
parent3f4d1c639347317788f2c5080f89de53772499ce (diff)
downloadgit-3d1dd4728b83e4c08d9fa7aaf2aa946e1012e061.tar.gz
git-3d1dd4728b83e4c08d9fa7aaf2aa946e1012e061.tar.xz
reduce_heads(): thinkofix
When comparing two commit objects for equality, it is sufficient to compare their in-core pointers because the object layer guarantees the uniqueness. However, comparing pointers to two "struct commit_list" instances that point at the same commit does not make any sense. Spotted by Sverre Hvammen Johansen who wrote an additional test to expose the problem, fixed by Miklos Vajna. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index d20b14ee3..03e73f323 100644
--- a/commit.c
+++ b/commit.c
@@ -747,7 +747,7 @@ struct commit_list *reduce_heads(struct commit_list *heads)
num_other = 0;
for (q = heads; q; q = q->next) {
- if (p == q)
+ if (p->item == q->item)
continue;
other[num_other++] = q->item;
}