summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-06-08 18:06:27 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-08 18:06:27 -0700
commitdc57a9be5ee2f9c719965a9e6c7a2ed97af180a1 (patch)
tree9dc21d8b5134e7c47d2ffeff0a58d0f208c6c599 /t
parentMerge branch 'cb/t4210-illseq-auto-detect' (diff)
parentcommit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag (diff)
downloadtgif-dc57a9be5ee2f9c719965a9e6c7a2ed97af180a1.tar.xz
Merge branch 'tb/commit-graph-no-check-oids'
Clean-up the commit-graph codepath. * tb/commit-graph-no-check-oids: commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag t5318: reorder test below 'graph_read_expect' commit-graph.c: simplify 'fill_oids_from_commits' builtin/commit-graph.c: dereference tags in builtin builtin/commit-graph.c: extract 'read_one_commit()' commit-graph.c: peel refs in 'add_ref_to_set' commit-graph.c: show progress of finding reachable commits commit-graph.c: extract 'refs_cb_data'
Diffstat (limited to 't')
-rwxr-xr-xt/t5318-commit-graph.sh25
1 files changed, 16 insertions, 9 deletions
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 424599959c..a79c624875 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -46,15 +46,6 @@ test_expect_success 'create commits and repack' '
git repack
'
-test_expect_success 'exit with correct error on bad input to --stdin-commits' '
- cd "$TRASH_DIRECTORY/full" &&
- echo HEAD | test_expect_code 1 git commit-graph write --stdin-commits 2>stderr &&
- test_i18ngrep "unexpected non-hex object ID: HEAD" stderr &&
- # valid tree OID, but not a commit OID
- git rev-parse HEAD^{tree} | test_expect_code 1 git commit-graph write --stdin-commits 2>stderr &&
- test_i18ngrep "invalid commit object id" stderr
-'
-
graph_git_two_modes() {
git -c core.commitGraph=true $1 >output
git -c core.commitGraph=false $1 >expect
@@ -95,6 +86,22 @@ graph_read_expect() {
test_cmp expect output
}
+test_expect_success 'exit with correct error on bad input to --stdin-commits' '
+ cd "$TRASH_DIRECTORY/full" &&
+ # invalid, non-hex OID
+ echo HEAD >in &&
+ test_expect_code 1 git commit-graph write --stdin-commits <in 2>stderr &&
+ test_i18ngrep "unexpected non-hex object ID: HEAD" stderr &&
+ # non-existent OID
+ echo $ZERO_OID >in &&
+ test_expect_code 1 git commit-graph write --stdin-commits <in 2>stderr &&
+ test_i18ngrep "invalid object" stderr &&
+ # valid commit and tree OID
+ git rev-parse HEAD HEAD^{tree} >in &&
+ git commit-graph write --stdin-commits <in &&
+ graph_read_expect 3
+'
+
test_expect_success 'write graph' '
cd "$TRASH_DIRECTORY/full" &&
git commit-graph write &&