]> git.ipfire.org Git - thirdparty/git.git/commit
test-reach: test get_reachable_subset
authorDerrick Stolee <dstolee@microsoft.com>
Fri, 2 Nov 2018 13:14:47 +0000 (06:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 15:12:06 +0000 (00:12 +0900)
commit4c7bb45269ccd1fdb15347a675ff16e8a8534f68
treeecdca23b0ab6899d88ab6c11e391becfc8092491
parentfcb2c0769db54022b5bf3ed134623fbab48cdc20
test-reach: test get_reachable_subset

The get_reachable_subset() method returns the list of commits in
the 'to' array that are reachable from at least one commit in the
'from' array. Add tests that check this method works in a few
cases:

1. All commits in the 'to' list are reachable. This exercises the
   early-termination condition.

2. Some commits in the 'to' list are reachable. This exercises the
   loop-termination condition.

3. No commits in the 'to' list are reachable. This exercises the
   NULL return condition.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-reach.c
t/t6600-test-reach.sh