Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t5330-no-lazy-fetch-with-commit-graph.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t5330-no-lazy-fetch-with-commit-graph.sh` 47 lines ยท 1876 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='test for no lazy fetch with the commit-graph' 4 5 . ./test-lib.sh 6 7 test_expect_success 'setup: prepare a repository with a commit' ' 8 git init with-commit && 9 test_commit -C with-commit the-commit && 10 oid=$(git -C with-commit rev-parse HEAD) 11 ' 12 13 test_expect_success 'setup: prepare a repository with commit-graph contains the commit' ' 14 git init with-commit-graph && 15 echo "$(pwd)/with-commit/.git/objects" \ 16 >with-commit-graph/.git/objects/info/alternates && 17 # create a ref that points to the commit in alternates 18 git -C with-commit-graph update-ref refs/ref_to_the_commit "$oid" && 19 # prepare some other objects to commit-graph 20 test_commit -C with-commit-graph something && 21 git -c gc.writeCommitGraph=true -C with-commit-graph gc && 22 test_path_is_file with-commit-graph/.git/objects/info/commit-graph 23 ' 24 25 test_expect_success 'setup: change the alternates to what without the commit' ' 26 git init --bare without-commit && 27 git -C with-commit-graph cat-file -e $oid && 28 echo "$(pwd)/without-commit/objects" \ 29 >with-commit-graph/.git/objects/info/alternates && 30 test_must_fail git -C with-commit-graph cat-file -e $oid 31 ' 32 33 test_expect_success 'fetch any commit from promisor with the usage of the commit graph' ' 34 # setup promisor and prepare any commit to fetch 35 git -C with-commit-graph remote add origin "$(pwd)/with-commit" && 36 git -C with-commit-graph config remote.origin.promisor true && 37 git -C with-commit-graph config remote.origin.partialclonefilter blob:none && 38 test_commit -C with-commit any-commit && 39 anycommit=$(git -C with-commit rev-parse HEAD) && 40 test_must_fail env GIT_TRACE="$(pwd)/trace.txt" \ 41 git -C with-commit-graph fetch origin $anycommit 2>err && 42 test_grep ! "fatal: promisor-remote: unable to fork off fetch subprocess" err && 43 grep "git fetch origin" trace.txt >actual && 44 test_line_count = 1 actual 45 ' 46 47 test_done