diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-07-20 18:33:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-21 00:38:55 +0200 |
commit | 324dec0191e7579e3990e707d334652c0fe4a786 (patch) | |
tree | 7c29d194ffc8ad47af2be47d58839ced95d5bef9 /t/t6600-test-reach.sh | |
parent | test-reach: test is_descendant_of (diff) | |
download | git-324dec0191e7579e3990e707d334652c0fe4a786.tar.xz git-324dec0191e7579e3990e707d334652c0fe4a786.zip |
test-reach: test get_merge_bases_many
The get_merge_bases_many method returns a list of merge bases for a
single commit (A) against a list of commits (X). Some care is needed in
constructing the expected behavior because the result is not the
expected merge-base for an octopus merge with those parents but instead
the set of maximal commits that are reachable from A and at least one of
the commits in X.
Add get_merge_bases_many to 'test-tool reach' and create a test that
demonstrates that this output returns multiple results. Specifically, we
select a list of three commits such that we output two commits that are
reachable from one of the first two, respectively, and none are
reachable from the third.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6600-test-reach.sh')
-rwxr-xr-x | t/t6600-test-reach.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t6600-test-reach.sh b/t/t6600-test-reach.sh index 98bcb17960..d43e1a61d5 100755 --- a/t/t6600-test-reach.sh +++ b/t/t6600-test-reach.sh @@ -123,4 +123,19 @@ test_expect_success 'is_descendant_of:miss' ' test_three_modes is_descendant_of ' +test_expect_success 'get_merge_bases_many' ' + cat >input <<-\EOF && + A:commit-5-7 + X:commit-4-8 + X:commit-6-6 + X:commit-8-3 + EOF + { + echo "get_merge_bases_many(A,X):" && + git rev-parse commit-5-6 \ + commit-4-7 | sort + } >expect && + test_three_modes get_merge_bases_many +' + test_done |