mirror of
https://github.com/git/git.git
synced 2024-11-09 02:33:11 +01:00
7d004199d1
The revision limiter uses the commit date to decide when it has seen enough commits to finalize the revision list, but that can get confused if there are incorrect dates far in the past on some commits. This makes the logic a bit more robust by - we always walk an extra SLOP commits from the source list even if we decide that the source list is probably all done (unless the source is entirely empty, of course, because then we really can't do anything at all) - we keep track of the date of the last commit we added to the destination list (this will *generally* be the oldest entry we've seen so far) - we compare that with the youngest entry (the first one) of the source list, and if the destination is older than the source, we know we want to look at the source. which causes occasional date mishaps to be handled cleanly. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
38 lines
531 B
Bash
Executable file
38 lines
531 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='properly cull all ancestors'
|
|
|
|
. ./test-lib.sh
|
|
|
|
commit () {
|
|
test_tick &&
|
|
echo $1 >file &&
|
|
git commit -a -m $1 &&
|
|
git tag $1
|
|
}
|
|
|
|
test_expect_success setup '
|
|
|
|
touch file &&
|
|
git add file &&
|
|
|
|
commit one &&
|
|
|
|
test_tick=$(($test_tick - 2400))
|
|
|
|
commit two &&
|
|
commit three &&
|
|
commit four &&
|
|
|
|
git log --pretty=oneline --abbrev-commit
|
|
'
|
|
|
|
test_expect_success 'one is ancestor of others and should not be shown' '
|
|
|
|
git rev-list one --not four >result &&
|
|
>expect &&
|
|
test_cmp expect result
|
|
|
|
'
|
|
|
|
test_done
|