From: Junio C Hamano Date: Mon, 20 Aug 2018 18:33:51 +0000 (-0700) Subject: Merge branch 'ds/commit-graph-fsck' X-Git-Tag: v2.19.0-rc0~24 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5dd54744b8443494f2190d5c9efa4b5ae0f69f06?ds=inline;hp=-c Merge branch 'ds/commit-graph-fsck' Test fix. * ds/commit-graph-fsck: t5318: use 'test_cmp_bin' to compare commit-graph files --- 5dd54744b8443494f2190d5c9efa4b5ae0f69f06 diff --combined t/t5318-commit-graph.sh index 4f17d7701e,04516d6465..1c148ebf21 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh @@@ -254,9 -254,9 +254,9 @@@ test_expect_success 'check that gc comp git config gc.writeCommitGraph true && git gc && cp $objdir/info/commit-graph commit-graph-after-gc && - ! test_cmp commit-graph-before-gc commit-graph-after-gc && + ! test_cmp_bin commit-graph-before-gc commit-graph-after-gc && git commit-graph write --reachable && - test_cmp commit-graph-after-gc $objdir/info/commit-graph + test_cmp_bin commit-graph-after-gc $objdir/info/commit-graph ' # the verify tests below expect the commit-graph to contain @@@ -431,39 -431,4 +431,39 @@@ test_expect_success 'git fsck (checks c 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