@matheusbsbs / matheus-bagliano / commits / 1f1304d497
Fork 0

t5318: reorder test below 'graph_read_expect'

In the subsequent commit, we will introduce a dependency on 'graph_read_expect' from t5318.7. Preemptively move it below 'graph_read_expect()'s definition so that the test can call it. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Taylor Blau committed May 13, 2020 at 15:59 UTC 1f1304d4976f54b1afa5d71b55e41c6c1b5f9ac1
1 file changed +9 -9
t/t5318-commit-graph.sh
+9 -9
@@ -42,15 +42,6 @@ test_expect_success 'create commits and repack' '
42 git repack
43 '
44
45 -test_expect_success 'exit with correct error on bad input to --stdin-commits' '
46 - cd "$TRASH_DIRECTORY/full" &&
47 - echo HEAD | test_expect_code 1 git commit-graph write --stdin-commits 2>stderr &&
48 - test_i18ngrep "unexpected non-hex object ID: HEAD" stderr &&
49 - # valid tree OID, but not a commit OID
50 - git rev-parse HEAD^{tree} | test_expect_code 1 git commit-graph write --stdin-commits 2>stderr &&
51 - test_i18ngrep "invalid commit object id" stderr
52 -'
53 -
45 graph_git_two_modes() {
46 git -c core.commitGraph=true $1 >output
47 git -c core.commitGraph=false $1 >expect
@@ -91,6 +82,15 @@ graph_read_expect() {
82 test_cmp expect output
83 }
84
85 +test_expect_success 'exit with correct error on bad input to --stdin-commits' '
86 + cd "$TRASH_DIRECTORY/full" &&
87 + echo HEAD | test_expect_code 1 git commit-graph write --stdin-commits 2>stderr &&
88 + test_i18ngrep "unexpected non-hex object ID: HEAD" stderr &&
89 + # valid tree OID, but not a commit OID
90 + git rev-parse HEAD^{tree} | test_expect_code 1 git commit-graph write --stdin-commits 2>stderr &&
91 + test_i18ngrep "invalid commit object id" stderr
92 +'
93 +
94 test_expect_success 'write graph' '
95 cd "$TRASH_DIRECTORY/full" &&
96 git commit-graph write &&