diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:47 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:47 -0700 |
| commit | 78a72ad4f8fa91adc876b2fc4b18fd370e43136d (patch) | |
| tree | a00b516dce8736567e679878f1b00966ef705f4a /t/t5318-commit-graph.sh | |
| parent | cfec6133cfcd97a23ca29c7d0ad8d2961796dd52 (diff) | |
| parent | dade47c06cf849b0ca180a8e6383b55ea6f75812 (diff) | |
| download | git-78a72ad4f8fa91adc876b2fc4b18fd370e43136d.tar.xz | |
Merge branch 'jt/commit-graph-per-object-store'
The singleton commit-graph in-core instance is made per in-core
repository instance.
* jt/commit-graph-per-object-store:
commit-graph: add repo arg to graph readers
commit-graph: store graph in struct object_store
commit-graph: add free_commit_graph
commit-graph: add missing forward declaration
object-store: add missing include
commit-graph: refactor preparing commit graph
Diffstat (limited to 't/t5318-commit-graph.sh')
| -rwxr-xr-x | t/t5318-commit-graph.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 5947de3d24..4f17d7701e 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh @@ -431,4 +431,39 @@ test_expect_success 'git fsck (checks commit-graph)' ' test_must_fail git fsck ' +test_expect_success 'setup non-the_repository tests' ' + rm -rf repo && + git init repo && + test_commit -C repo one && + test_commit -C repo two && + git -C repo config core.commitGraph true && + git -C repo rev-parse two | \ + git -C repo commit-graph write --stdin-commits +' + +test_expect_success 'parse_commit_in_graph works for non-the_repository' ' + test-tool repository parse_commit_in_graph \ + repo/.git repo "$(git -C repo rev-parse two)" >actual && + echo $(git -C repo log --pretty="%ct" -1) \ + $(git -C repo rev-parse one) >expect && + test_cmp expect actual && + + test-tool repository parse_commit_in_graph \ + repo/.git repo "$(git -C repo rev-parse one)" >actual && + echo $(git -C repo log --pretty="%ct" -1 one) >expect && + test_cmp expect actual +' + +test_expect_success 'get_commit_tree_in_graph works for non-the_repository' ' + test-tool repository get_commit_tree_in_graph \ + repo/.git repo "$(git -C repo rev-parse two)" >actual && + echo $(git -C repo rev-parse two^{tree}) >expect && + test_cmp expect actual && + + test-tool repository get_commit_tree_in_graph \ + repo/.git repo "$(git -C repo rev-parse one)" >actual && + echo $(git -C repo rev-parse one^{tree}) >expect && + test_cmp expect actual +' + test_done |
