Skip to content

Commit 4b47a9a

Browse files
derrickstoleegitster
authored andcommitted
test-reach: add run_three_modes method
The 'test_three_modes' method assumes we are using the 'test-tool reach' command for our test. However, we may want to use the data shape of our commit graph and the three modes (no commit-graph, full commit-graph, partial commit-graph) for other git commands. Split test_three_modes to be a simple translation on a more general run_three_modes method that executes the given command and tests the actual output to the expected output. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aca4240 commit 4b47a9a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

t/t6600-test-reach.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,22 @@ test_expect_success 'setup' '
5353
git config core.commitGraph true
5454
'
5555

56-
test_three_modes () {
56+
run_three_modes () {
5757
test_when_finished rm -rf .git/objects/info/commit-graph &&
58-
test-tool reach $1 <input >actual &&
58+
"$@" <input >actual &&
5959
test_cmp expect actual &&
6060
cp commit-graph-full .git/objects/info/commit-graph &&
61-
test-tool reach $1 <input >actual &&
61+
"$@" <input >actual &&
6262
test_cmp expect actual &&
6363
cp commit-graph-half .git/objects/info/commit-graph &&
64-
test-tool reach $1 <input >actual &&
64+
"$@" <input >actual &&
6565
test_cmp expect actual
6666
}
6767

68+
test_three_modes () {
69+
run_three_modes test-tool reach "$@"
70+
}
71+
6872
test_expect_success 'ref_newer:miss' '
6973
cat >input <<-\EOF &&
7074
A:commit-5-7

0 commit comments

Comments
 (0)