summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f4d1c6)
raw | patch | inline | side by side (parent: 3f4d1c6)
author | Sverre Hvammen Johansen <hvammen+git@gmail.com> | |
Sun, 13 Jul 2008 08:13:55 +0000 (08:13 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 13 Jul 2008 20:53:54 +0000 (13:53 -0700) |
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>
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>
commit.c | patch | blob | history | |
t/t7600-merge.sh | patch | blob | history |
diff --git a/commit.c b/commit.c
index d20b14ee3efa7167070767aae0d130a978fac401..03e73f323ae082fac9f127900eede7aa3952dc44 100644 (file)
--- a/commit.c
+++ b/commit.c
num_other = 0;
for (q = heads; q; q = q->next) {
- if (p == q)
+ if (p->item == q->item)
continue;
other[num_other++] = q->item;
}
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 72ef2e55d9f9c175d94d4b37fac7606f537b6c71..f035ea376e4f0203df3d890bab49f65129e30540 100755 (executable)
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
test_debug 'gitk --all'
+test_expect_success 'merge c1 with c0, c2, c0, and c1' '
+ git reset --hard c1 &&
+ git config branch.master.mergeoptions "" &&
+ test_tick &&
+ git merge c0 c2 c0 c1 &&
+ verify_merge file result.1-5 &&
+ verify_parents $c1 $c2
+'
+
+test_debug 'gitk --all'
+
test_done