mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-09 23:33:34 -05:00
t6600: test --maximal-only and --independent
Add a test that verifies the 'git rev-list --maximal-only' option produces the same set of commits as 'git merge-base --independent'. This equivalence was noted when the feature was first created, but we are about to update the implementation to use a common algorithm in this case where the user intention is identical. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2f8c3f6a5a
commit
295fb82264
@@ -837,4 +837,49 @@ test_expect_success 'rev-list --maximal-only (range)' '
|
||||
--first-parent --exclude-first-parent-only
|
||||
'
|
||||
|
||||
test_expect_success 'rev-list --maximal-only matches merge-base --independent' '
|
||||
# Mix of independent and dependent
|
||||
git merge-base --independent \
|
||||
refs/heads/commit-5-2 \
|
||||
refs/heads/commit-3-2 \
|
||||
refs/heads/commit-2-5 >expect &&
|
||||
sort expect >expect.sorted &&
|
||||
git rev-list --maximal-only \
|
||||
refs/heads/commit-5-2 \
|
||||
refs/heads/commit-3-2 \
|
||||
refs/heads/commit-2-5 >actual &&
|
||||
sort actual >actual.sorted &&
|
||||
test_cmp expect.sorted actual.sorted &&
|
||||
|
||||
# All independent commits.
|
||||
git merge-base --independent \
|
||||
refs/heads/commit-5-2 \
|
||||
refs/heads/commit-4-3 \
|
||||
refs/heads/commit-3-4 \
|
||||
refs/heads/commit-2-5 >expect &&
|
||||
sort expect >expect.sorted &&
|
||||
git rev-list --maximal-only \
|
||||
refs/heads/commit-5-2 \
|
||||
refs/heads/commit-4-3 \
|
||||
refs/heads/commit-3-4 \
|
||||
refs/heads/commit-2-5 >actual &&
|
||||
sort actual >actual.sorted &&
|
||||
test_cmp expect.sorted actual.sorted &&
|
||||
|
||||
# Only one independent.
|
||||
git merge-base --independent \
|
||||
refs/heads/commit-1-1 \
|
||||
refs/heads/commit-4-2 \
|
||||
refs/heads/commit-4-4 \
|
||||
refs/heads/commit-8-4 >expect &&
|
||||
sort expect >expect.sorted &&
|
||||
git rev-list --maximal-only \
|
||||
refs/heads/commit-1-1 \
|
||||
refs/heads/commit-4-2 \
|
||||
refs/heads/commit-4-4 \
|
||||
refs/heads/commit-8-4 >actual &&
|
||||
sort actual >actual.sorted &&
|
||||
test_cmp expect.sorted actual.sorted
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
Reference in New Issue
Block a user