Merge branch 'kk/revwalk-slop-too-many-commit-within-a-second'
authorJunio C Hamano <gitster@pobox.com>
Thu, 28 Mar 2013 21:38:25 +0000 (14:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Mar 2013 21:38:25 +0000 (14:38 -0700)
Allow the revision "slop" code to look deeper while commits with
exactly the same timestamps come next to each other (which can
often happen after a large "am" and "rebase" session).

* kk/revwalk-slop-too-many-commit-within-a-second:
Fix revision walk for commits with the same dates

revision.c
t/t6009-rev-list-parent.sh
index 78397d6486203a6b7242c8ea866780979876e685..71e62d831229773a9af2c4a81d72be5b33d3c921 100644 (file)
@@ -709,7 +709,7 @@ static int still_interesting(struct commit_list *src, unsigned long date, int sl
         * Does the destination list contain entries with a date
         * before the source list? Definitely _not_ done.
         */
-       if (date < src->item->date)
+       if (date <= src->item->date)
                return SLOP;
 
        /*
index 30507407ff6375f96c632c7c3f62ae3d338ed5ea..66cda17ef342a2791ce7bac873eecfd4cf319faf 100755 (executable)
@@ -133,4 +133,17 @@ test_expect_success 'dodecapus' '
        check_revlist "--min-parents=13" &&
        check_revlist "--min-parents=4 --max-parents=11" tetrapus
 '
+
+test_expect_success 'ancestors with the same commit time' '
+
+       test_tick_keep=$test_tick &&
+       for i in 1 2 3 4 5 6 7 8; do
+               test_tick=$test_tick_keep
+               test_commit t$i
+       done &&
+       git rev-list t1^! --not t$i >result &&
+       >expect &&
+       test_cmp expect result
+'
+
 test_done