Skip to content

Commit d6b4071

Browse files
derrickstoleegitster
authored andcommitted
test-reach: add rev-list tests
The rev-list command is critical to Git's functionality. Ensure it works in the three commit-graph environments constructed in t6600-test-reach.sh. Here are a few important types of rev-list operations: * Basic: git rev-list --topo-order HEAD * Range: git rev-list --topo-order compare..HEAD * Ancestry: git rev-list --topo-order --ancestry-path compare..HEAD * Symmetric Difference: git rev-list --topo-order compare...HEAD Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4b47a9a commit d6b4071

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

t/t6600-test-reach.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,88 @@ test_expect_success 'commit_contains:miss' '
243243
test_three_modes commit_contains --tag
244244
'
245245

246+
test_expect_success 'rev-list: basic topo-order' '
247+
git rev-parse \
248+
commit-6-6 commit-5-6 commit-4-6 commit-3-6 commit-2-6 commit-1-6 \
249+
commit-6-5 commit-5-5 commit-4-5 commit-3-5 commit-2-5 commit-1-5 \
250+
commit-6-4 commit-5-4 commit-4-4 commit-3-4 commit-2-4 commit-1-4 \
251+
commit-6-3 commit-5-3 commit-4-3 commit-3-3 commit-2-3 commit-1-3 \
252+
commit-6-2 commit-5-2 commit-4-2 commit-3-2 commit-2-2 commit-1-2 \
253+
commit-6-1 commit-5-1 commit-4-1 commit-3-1 commit-2-1 commit-1-1 \
254+
>expect &&
255+
run_three_modes git rev-list --topo-order commit-6-6
256+
'
257+
258+
test_expect_success 'rev-list: first-parent topo-order' '
259+
git rev-parse \
260+
commit-6-6 \
261+
commit-6-5 \
262+
commit-6-4 \
263+
commit-6-3 \
264+
commit-6-2 \
265+
commit-6-1 commit-5-1 commit-4-1 commit-3-1 commit-2-1 commit-1-1 \
266+
>expect &&
267+
run_three_modes git rev-list --first-parent --topo-order commit-6-6
268+
'
269+
270+
test_expect_success 'rev-list: range topo-order' '
271+
git rev-parse \
272+
commit-6-6 commit-5-6 commit-4-6 commit-3-6 commit-2-6 commit-1-6 \
273+
commit-6-5 commit-5-5 commit-4-5 commit-3-5 commit-2-5 commit-1-5 \
274+
commit-6-4 commit-5-4 commit-4-4 commit-3-4 commit-2-4 commit-1-4 \
275+
commit-6-3 commit-5-3 commit-4-3 \
276+
commit-6-2 commit-5-2 commit-4-2 \
277+
commit-6-1 commit-5-1 commit-4-1 \
278+
>expect &&
279+
run_three_modes git rev-list --topo-order commit-3-3..commit-6-6
280+
'
281+
282+
test_expect_success 'rev-list: range topo-order' '
283+
git rev-parse \
284+
commit-6-6 commit-5-6 commit-4-6 \
285+
commit-6-5 commit-5-5 commit-4-5 \
286+
commit-6-4 commit-5-4 commit-4-4 \
287+
commit-6-3 commit-5-3 commit-4-3 \
288+
commit-6-2 commit-5-2 commit-4-2 \
289+
commit-6-1 commit-5-1 commit-4-1 \
290+
>expect &&
291+
run_three_modes git rev-list --topo-order commit-3-8..commit-6-6
292+
'
293+
294+
test_expect_success 'rev-list: first-parent range topo-order' '
295+
git rev-parse \
296+
commit-6-6 \
297+
commit-6-5 \
298+
commit-6-4 \
299+
commit-6-3 \
300+
commit-6-2 \
301+
commit-6-1 commit-5-1 commit-4-1 \
302+
>expect &&
303+
run_three_modes git rev-list --first-parent --topo-order commit-3-8..commit-6-6
304+
'
305+
306+
test_expect_success 'rev-list: ancestry-path topo-order' '
307+
git rev-parse \
308+
commit-6-6 commit-5-6 commit-4-6 commit-3-6 \
309+
commit-6-5 commit-5-5 commit-4-5 commit-3-5 \
310+
commit-6-4 commit-5-4 commit-4-4 commit-3-4 \
311+
commit-6-3 commit-5-3 commit-4-3 \
312+
>expect &&
313+
run_three_modes git rev-list --topo-order --ancestry-path commit-3-3..commit-6-6
314+
'
315+
316+
test_expect_success 'rev-list: symmetric difference topo-order' '
317+
git rev-parse \
318+
commit-6-6 commit-5-6 commit-4-6 \
319+
commit-6-5 commit-5-5 commit-4-5 \
320+
commit-6-4 commit-5-4 commit-4-4 \
321+
commit-6-3 commit-5-3 commit-4-3 \
322+
commit-6-2 commit-5-2 commit-4-2 \
323+
commit-6-1 commit-5-1 commit-4-1 \
324+
commit-3-8 commit-2-8 commit-1-8 \
325+
commit-3-7 commit-2-7 commit-1-7 \
326+
>expect &&
327+
run_three_modes git rev-list --topo-order commit-3-8...commit-6-6
328+
'
329+
246330
test_done

0 commit comments

Comments
 (0)